1818package HackGUI ;
1919
2020import Hack .Controller .*;
21- import java . io .*;
21+
2222import javax .swing .*;
23- import javax .swing .event .* ;
24- import java . awt .event .* ;
23+ import javax .swing .event .ChangeEvent ;
24+ import javax . swing .event .ChangeListener ;
2525import java .awt .*;
26- import java .util .*;
26+ import java .awt .event .ActionEvent ;
27+ import java .awt .event .ActionListener ;
28+ import java .awt .event .InputEvent ;
29+ import java .awt .event .KeyEvent ;
30+ import java .io .File ;
31+ import java .util .Collection ;
32+ import java .util .Hashtable ;
33+ import java .util .Vector ;
2734
2835/**
2936 * This class represents the GUI of the controller component.
@@ -112,7 +119,7 @@ public class ControllerComponent extends JFrame implements ControllerGUI,
112119 protected JRadioButtonMenuItem partAnimMenuItem , fullAnimMenuItem , noAnimMenuItem ;
113120
114121 // the message label (status line)
115- protected JLabel messageLbl = new JLabel ();
122+ private JTextField messageLbl = new JTextField ();
116123
117124 // component for displaying the script, output file and comparison file.
118125 protected FileDisplayComponent scriptComponent ;
@@ -126,6 +133,7 @@ public class ControllerComponent extends JFrame implements ControllerGUI,
126133 * Constructs a new ControllerComponent.
127134 */
128135 public ControllerComponent () {
136+ messageLbl .setEditable (false );
129137 listeners = new Vector <ControllerEventListener >();
130138 formatCombo = new TitledComboBox ("Format:" , "Numeric display format" ,
131139 new String []{"Decimal" , "Hexa" , "Binary" }, 75 );
@@ -153,15 +161,11 @@ public void setSimulator(HackSimulatorGUI simulator) {
153161 ((JComponent )simulator ).revalidate ();
154162 repaint ();
155163
156- if (simulator .getUsageFileName () != null ) {
157- usageWindow = new HTMLViewFrame (simulator .getUsageFileName ());
158- usageWindow .setSize (450 , 430 );
159- }
164+ usageWindow = new HTMLViewFrame (getClass ().getResource ("/usage.html" ));
165+ usageWindow .setSize (450 , 430 );
160166
161- if (simulator .getAboutFileName () != null ) {
162- aboutWindow = new HTMLViewFrame (simulator .getAboutFileName ());
163- aboutWindow .setSize (450 , 420 );
164- }
167+ aboutWindow = new HTMLViewFrame (getClass ().getResource ("/about.html" ));
168+ aboutWindow .setSize (450 , 420 );
165169 }
166170
167171
0 commit comments