|
@@ -23,6 +23,10 @@ public class Interface implements ActionListener {
|
23
|
23
|
//null (use the default), "Metal", "System", "Motif", "GTK+"
|
24
|
24
|
final static String LOOKANDFEEL = "System";
|
25
|
25
|
|
|
26
|
+ public Interface(Controller controller) {
|
|
27
|
+ this.controller = controller;
|
|
28
|
+ }
|
|
29
|
+
|
26
|
30
|
public Component createComponents() {
|
27
|
31
|
PseudotextField = new JTextField(); //Pseudo setup
|
28
|
32
|
PseudotextField.setColumns(10);
|
|
@@ -128,7 +132,7 @@ public class Interface implements ActionListener {
|
128
|
132
|
* this method should be invoked from the
|
129
|
133
|
* event-dispatching thread.
|
130
|
134
|
*/
|
131
|
|
- public static void createAndShowGUI() {
|
|
135
|
+ public static Interface createAndShowGUI(Controller controller) {
|
132
|
136
|
//Set the look and feel.
|
133
|
137
|
initLookAndFeel();
|
134
|
138
|
|
|
@@ -139,15 +143,17 @@ public class Interface implements ActionListener {
|
139
|
143
|
JFrame frame = new JFrame("SwingApplication");
|
140
|
144
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
141
|
145
|
|
142
|
|
- Interface app = new Interface();
|
|
146
|
+ Interface app = new Interface(controller);
|
143
|
147
|
Component contents = app.createComponents();
|
144
|
148
|
frame.getContentPane().add(contents, BorderLayout.CENTER);
|
145
|
149
|
|
146
|
150
|
//Display the window.
|
147
|
151
|
frame.pack();
|
148
|
152
|
frame.setVisible(true);
|
149
|
|
- }
|
150
|
153
|
|
|
154
|
+ return app;
|
|
155
|
+ }
|
|
156
|
+ /*
|
151
|
157
|
public static void main(String[] args) throws IOException {
|
152
|
158
|
//Schedule a job for the event-dispatching thread:
|
153
|
159
|
//creating and showing this application’s GUI.
|
|
@@ -156,6 +162,6 @@ public class Interface implements ActionListener {
|
156
|
162
|
createAndShowGUI();
|
157
|
163
|
}
|
158
|
164
|
});
|
159
|
|
- }
|
|
165
|
+ }*/
|
160
|
166
|
}
|
161
|
167
|
|