import SimKit.*; import java.awt.*; import java.util.Enumeration;
public class RGBallsGUI extends GUI {
protected TextField fNumPlayers, fEndTime, fGreenTransitTime, fRedTransitTime;
protected Checkbox debugInfoOn;
public static void main(String args[]) { Simulation.dbgPrint(" main()");
new RGBallsGUI().run(); Simulation.dbgPrint("RGBallGUI main exiting");
}
public RGBallsGUI() { Simulation.dbgPrint(" RGBallGUI()");
}
public void init() {
super.init(); Simulation.dbgPrint(" RGBallGUI.init()");
Panel configPanel = new Panel(); configPanel.setLayout(new GridLayout(6,1));
configPanel.add(new Label("# of Players"));
fNumPlayers = new TextField("8",5); configPanel.add(fNumPlayers);
configPanel.add(new Label("Simulation End Time"));
fEndTime = new TextField("2500",10); configPanel.add(fEndTime);
configPanel.add(new Label("Green Ball Transit Time"));
fGreenTransitTime = new TextField("8",5); configPanel.add(fGreenTransitTime);
configPanel.add(new Label("Red Ball Transit Time"));
fRedTransitTime = new TextField("16",5); configPanel.add(fRedTransitTime);
debugInfoOn = new Checkbox("User Debugging Info"); debugInfoOn.setState(true);
configPanel.add(debugInfoOn);
this.add(configPanel);
} // end init
Previous slide | Next slide | Back to first slide | View graphic version |