programming-examples/java/Applets_AWT/Demonstrating the null layout manager.java
2019-11-15 12:59:38 +01:00

35 lines
770 B
Java

Demonstrating the null layout manager
import java.applet.Applet;
import java.awt.*;
public class NoLayout extends Applet {
private Choice cb;
private Button b1, b2, b3;
public void init()
{
// do not use a layout manager
setLayout( null );
cb = new Choice();
cb.addItem( "Item 1" );
cb.addItem( "Item 2" );
cb.addItem( "Item 3" );
b1 = new Button( "Button" );
b2 = new Button( "Another Button" );
b3 = new Button( "Last Button" );
add( cb );
add( b1 );
add( b2 );
add( b3 );
b1.reshape( 15, 9, 60, 26 );
b2.reshape( 100, 40, 90, 22 );
b3.reshape( 220, 20, 70, 55);
cb.reshape( 50, 80, 70, 17);
}
}