diff options
Diffstat (limited to 'lib/example/MyClass.java')
-rw-r--r-- | lib/example/MyClass.java | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/lib/example/MyClass.java b/lib/example/MyClass.java index 632e99a..ef47ace 100644 --- a/lib/example/MyClass.java +++ b/lib/example/MyClass.java | |||
@@ -1,47 +1,44 @@ | |||
1 | package example; | 1 | package example; |
2 | 2 | ||
3 | 3 | ||
4 | 4 | import java.awt.Button; | |
5 | import java.awt.*; | 5 | import java.awt.Frame; |
6 | import java.awt.event.*; | 6 | import java.awt.event.WindowAdapter; |
7 | import java.awt.event.WindowEvent; | ||
7 | import layout.TableLayout; | 8 | import layout.TableLayout; |
8 | 9 | ||
9 | public class MyClass | 10 | public class MyClass { |
10 | { | ||
11 | 11 | ||
12 | public static void main (String args[]) | 12 | public static void main(String args[]) { |
13 | { | ||
14 | Frame frame = new Frame("MyTitle"); | 13 | Frame frame = new Frame("MyTitle"); |
15 | frame.setBounds (100, 100, 300, 300); | 14 | frame.setBounds(100, 100, 300, 300); |
16 | 15 | ||
17 | double size[][] = | 16 | double size[][] = |
18 | {{-2.0, 10.0, 50.0, -1.0, 10.0}, // Columns | 17 | {{-2.0, 10.0, 50.0, -1.0, 10.0}, // Columns |
19 | {-2.0, 10.0, 0.25, -1.0, 10.0}}; // Rows | 18 | {-2.0, 10.0, 0.25, -1.0, 10.0}}; // Rows |
20 | 19 | ||
21 | frame.setLayout (new TableLayout(size)); | 20 | frame.setLayout(new TableLayout(size)); |
22 | 21 | ||
23 | Button button; | 22 | Button button; |
24 | button = new Button("3, 3, R, C"); | 23 | button = new Button("3, 3, R, C"); |
25 | frame.add (button, "3, 3, R, C"); | 24 | frame.add(button, "3, 3, R, C"); |
26 | button = new Button("3, 3, L, T"); | 25 | button = new Button("3, 3, L, T"); |
27 | frame.add (button, "3, 3, L, T"); | 26 | frame.add(button, "3, 3, L, T"); |
28 | button = new Button("2, 3, C, T"); | 27 | button = new Button("2, 3, C, T"); |
29 | frame.add (button, "2, 3, C, T"); | 28 | frame.add(button, "2, 3, C, T"); |
30 | button = new Button("3, 2, L, C"); | 29 | button = new Button("3, 2, L, C"); |
31 | frame.add (button, "3, 2, L, C"); | 30 | frame.add(button, "3, 2, L, C"); |
32 | button = new Button("2, 2, F, F"); | 31 | button = new Button("2, 2, F, F"); |
33 | frame.add (button, "2, 2, F, F"); | 32 | frame.add(button, "2, 2, F, F"); |
34 | button = new Button("3, 3, C, C"); | 33 | button = new Button("3, 3, C, C"); |
35 | frame.add (button, "3, 3, C, C"); | 34 | frame.add(button, "3, 3, C, C"); |
36 | 35 | ||
37 | frame.addWindowListener | 36 | frame.addWindowListener |
38 | (new WindowAdapter() | 37 | (new WindowAdapter() { |
39 | { | 38 | public void windowClosing(WindowEvent e) { |
40 | public void windowClosing (WindowEvent e) | 39 | System.exit(0); |
41 | { | 40 | } |
42 | System.exit (0); | 41 | } |
43 | } | ||
44 | } | ||
45 | ); | 42 | ); |
46 | 43 | ||
47 | frame.show(); | 44 | frame.show(); |