1 package nmp.util;
2
3 import java.awt.*;
4 import java.awt.event.*;
5 import java.io.*;
6
7 public class AWTTest
8 extends Frame
9 {
10 public AWTTest( String[] args) {
11 super( "AWTTest");
12 Panel p = new Panel( new BorderLayout());
13 Panel p2 = new Panel();
14 p2.setLayout( new GridLayout( 0, 1));
15 if( args == null || args.length == 0) {
16 p2.add( new Label( "No params"));
17 } else
18 for( int i = 0; i < args.length; i++)
19 p2.add( new Label( "Param " + i + " : " + args[i]));
20 p.add( "Center", p2);
21 Button b = new Button( "Exit");
22 b.addActionListener( new ActionListener() {
23 public void actionPerformed(ActionEvent e) {
24 System.exit(0);
25 }
26 });
27 p.add( "South", b);
28 add( "Center", p);
29 pack();
30 setVisible( true);
31 }
32
33 public static void main( String[] args) {
34 new AWTTest( args);
35 }
36 }
This page was automatically generated by Maven