import java.awt.*;
public class BorderLayoutTest {
public static void main (String []args){
Frame f= new Frame();
f.setTitle("BorderLayoutTest");
f.setLayout(new BorderLayout());
Button b1= new Button("Boton 1(Norte)");
f.add(b1,BorderLayout.NORTH);
Button b2= new Button("Boton 2(Oeste");
f.add(b2,BorderLayout.WEST);
Button b3= new Button("Boton 3(Centro)");
f.add(b3,BorderLayout.CENTER);
Button b4= new Button("Boton 4(Este)");
f.add(b4,BorderLayout.EAST);
Button b5= new Button("Boton 5(Sur)");
f.add(b5,BorderLayout.SOUTH);
f.pack();
f.setVisible(true);
}
}
No hay comentarios:
Publicar un comentario