import java.awt.*; import MainWin; // This is the applet that start the simulation // it contains only one button that create the main window of the // simulation. public class RedBlack extends java.applet.Applet { Button start; MainWin main; public void init () { start = new Button("Start"); start.setForeground(Color.black); start.setBackground(Color.red); start.setFont(new Font("TimesRoman",Font.BOLD,30)); setLayout(new GridLayout(1,0,10,10)); add(start); } public boolean action(Event evnt, Object obj) { Object target = evnt.target; if (target == start) { main = new MainWin(this); main.resize(800,600); main.setResizable(false); main.show(); start.disable(); } return true; } }