74 public void init()
75 {
76 //Create instructions for the user here, as well as set up
77 // the environment -- set the layout manager, add buttons,
78 // etc.
79
80 this.setLayout (new BorderLayout ());
81
82 String[] instructions =
83 {
84 "This is an AUTOMATIC test",
85 "simply wait until it is done"
86 };
87 //Sysout.createDialog( );
88 //Sysout.printInstructions( instructions );
89
90 }//End init()
91 public void start ()
92 {
93 //Get things going. Request focus, set size, et cetera
94 System.setSecurityManager( new SecurityManager() {
95 // deny AWTPermission("showWindowWithoutWarningBanner")
96 public boolean checkTopLevelWindow(Object window) {
97 return false;
98 }
99 });
100 JFrame frame = new JFrame("Window Test");
101 frame.setBounds(50, 50, 200, 200);
102 frame.show();
103
104 JWindow window = new JWindow( frame );
105 JButton jbutton1 = new JButton( "First" );
106 jbutton1.addMouseListener( new MouseAdapter() {
107 public void mousePressed( MouseEvent me ) {
108 buttonClicked = true;
109 }
110 });
111 JButton jbutton2 = new JButton( "Second" );
112 window.setLocation( 300, 300 );
113
114 window.add("North", jbutton1);
115 window.add("South", jbutton2);
116
117 window.pack();
118 window.show();
119 //wait for frame to show:
|
74 public void init()
75 {
76 //Create instructions for the user here, as well as set up
77 // the environment -- set the layout manager, add buttons,
78 // etc.
79
80 this.setLayout (new BorderLayout ());
81
82 String[] instructions =
83 {
84 "This is an AUTOMATIC test",
85 "simply wait until it is done"
86 };
87 //Sysout.createDialog( );
88 //Sysout.printInstructions( instructions );
89
90 }//End init()
91 public void start ()
92 {
93 //Get things going. Request focus, set size, et cetera
94 JFrame frame = new JFrame("Window Test");
95 frame.setBounds(50, 50, 200, 200);
96 frame.show();
97
98 JWindow window = new JWindow( frame );
99 JButton jbutton1 = new JButton( "First" );
100 jbutton1.addMouseListener( new MouseAdapter() {
101 public void mousePressed( MouseEvent me ) {
102 buttonClicked = true;
103 }
104 });
105 JButton jbutton2 = new JButton( "Second" );
106 window.setLocation( 300, 300 );
107
108 window.add("North", jbutton1);
109 window.add("South", jbutton2);
110
111 window.pack();
112 window.show();
113 //wait for frame to show:
|