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