ejercicio 9.
import java.awt.*;
import java.awt.event.*;
public class Ventana9 extends Frame {
public Button boton;
public Button boton1, boton2;
public Ventana9(String titulo, int x, int y){
super(titulo);
setSize(x,y);
setVisible(true);
setLayout(new FlowLayout()); // gestor de diseno
boton = new Button("Un Boton " );
this.add(boton);
boton1=new Button("un botn 1");
this.add(boton1);
boton2=new Button("un botn 2");
this.add(boton2);
}
public static void main (String[] args){
Ventana9 miVentana=new Ventana9("una ventana", 600,400);
miVentana.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}
No hay comentarios:
Publicar un comentario