Java Reference
In-Depth Information
cp . add ( new
new JLabel ( "Password:" , SwingConstants . RIGHT ));
cp . add ( new
new JPasswordField ( 20 ));
cp . add ( new
new JLabel ( "Security Domain:" , SwingConstants . RIGHT ));
cp . add ( new
new JTextField ( 20 ));
// cp.add(new JLabel("Monkey wrench in works"));
f . pack ();
f . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );
f . setLocation ( 200 , 200 );
f . setVisible ( true
true );
}
static
static void
void testFiveCols () {
final
final JFrame f = new
new JFrame ( "EntryLayout Five Columns" );
Container cp = f . getContentPane ();
double
double widths [] = { . 25 , . 33 , . 10 , . 10 , . 20 };
cp . setLayout ( new
new EntryLayout ( widths ));
cp . add ( new
new JLabel ( "Login:" , SwingConstants . RIGHT ));
cp . add ( new
new JTextField ( 10 ));
cp . add ( new
new JCheckBox ());
cp . add ( new
new JCheckBox ());
cp . add ( new
new JCheckBox ());
cp . add ( new
new JLabel ( "Password:" , SwingConstants . RIGHT ));
cp . add ( new
new JPasswordField ( 20 ));
cp . add ( new
new JCheckBox ());
cp . add ( new
new JCheckBox ());
cp . add ( new
new JCheckBox ());
cp . add ( new
new JLabel ( "Security Domain:" , SwingConstants . RIGHT ));
cp . add ( new
new JTextField ( 20 ));
cp . add ( new
new JCheckBox ());
cp . add ( new
new JCheckBox ());
cp . add ( new
new JCheckBox ());
f . pack ();
f . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );
f . setLocation ( 200 , 200 );
f . setVisible ( true
true );
}
@Test
public
public void
void trivialTest () {
try
try {
main ( null
null );
} catch
catch ( HeadlessException he ) {
System . out . println ( "EntryLayoutTest.test(): cannot test Headless" );
}
}
}
Search WWH ::




Custom Search