1 |
/* TestAWT.java -- Tests the AWT like testgtk |
/* TestAWT.java -- Tests the AWT like testgtk |
2 |
Copyright (C) 1998, 1999 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
51 |
prop.put ("awt.toolkit", "gnu.java.awt.peer.gtk.GtkToolkit"); |
prop.put ("awt.toolkit", "gnu.java.awt.peer.gtk.GtkToolkit"); |
52 |
} |
} |
53 |
MainWindow f = new MainWindow(); |
MainWindow f = new MainWindow(); |
54 |
|
System.out.println(f.isDisplayable()); |
55 |
f.show(); |
f.show(); |
56 |
|
System.out.println(f.isDisplayable()); |
57 |
} |
} |
58 |
} |
} |
59 |
|
|
124 |
|
|
125 |
MainWindow () |
MainWindow () |
126 |
{ |
{ |
|
System.out.println ("INSET:" + getInsets ()); |
|
|
|
|
127 |
MenuBar mb = new MenuBar (); |
MenuBar mb = new MenuBar (); |
128 |
Menu menu = new Menu ("File"); |
Menu menu = new Menu ("File"); |
129 |
Menu submenu = new Menu ("Testing"); |
Menu submenu = new Menu ("Testing"); |
164 |
sp.add (p); |
sp.add (p); |
165 |
add (sp, "Center"); |
add (sp, "Center"); |
166 |
|
|
|
System.out.println (86 + (windows.size ()*22)); |
|
167 |
setSize (200, 86 + (windows.size ()*22)); |
setSize (200, 86 + (windows.size ()*22)); |
168 |
setTitle ("TestAWT"); |
setTitle ("TestAWT"); |
169 |
} |
} |
172 |
{ |
{ |
173 |
Button source = (Button) evt.getSource (); |
Button source = (Button) evt.getSource (); |
174 |
|
|
|
System.out.println (source); |
|
|
System.out.println (closeButton); |
|
|
|
|
175 |
if (source==closeButton) |
if (source==closeButton) |
176 |
{ |
{ |
|
System.out.println ("INSET:" + getInsets ()); |
|
|
System.out.println ("BOUNDS:" + getBounds ()); |
|
177 |
System.getProperties ().list (System.out); |
System.getProperties ().list (System.out); |
178 |
dispose(); |
dispose(); |
179 |
System.exit (0); |
System.exit (0); |
183 |
if (w.isVisible ()) |
if (w.isVisible ()) |
184 |
w.dispose (); |
w.dispose (); |
185 |
else |
else |
186 |
w.setVisible (true); |
{ |
187 |
|
w.setVisible (true); |
188 |
|
w.show(); |
189 |
|
} |
190 |
} |
} |
191 |
} |
} |
192 |
|
|
226 |
}); |
}); |
227 |
add (cb, "South"); |
add (cb, "South"); |
228 |
setTitle ("Buttons"); |
setTitle ("Buttons"); |
|
pack (); |
|
229 |
} |
} |
230 |
|
|
231 |
public void actionPerformed (ActionEvent evt) |
public void actionPerformed (ActionEvent evt) |
367 |
|
|
368 |
public void itemStateChanged (ItemEvent e) |
public void itemStateChanged (ItemEvent e) |
369 |
{ |
{ |
|
System.out.println (cursorChoice.getSelectedIndex()); |
|
370 |
cursorCanvas.setCursor (Cursor.getPredefinedCursor (cursorChoice.getSelectedIndex())); |
cursorCanvas.setCursor (Cursor.getPredefinedCursor (cursorChoice.getSelectedIndex())); |
371 |
} |
} |
372 |
} |
} |
545 |
setSize (85, 167); |
setSize (85, 167); |
546 |
} |
} |
547 |
} |
} |
|
|
|
|
|
|