NUEVO EJEMPLO
import java.applet.Applet;
import java.awt.event.*;
public class ventana
{
public static void main(String[] args)
{
crear v1=new crear();
v1.setSize(400,400);
v1.setTitle("VENTANA UNO CREADA");
v1.show();
v1.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e)
{System.exit(0);}});
crear v2=new crear();
v2.setSize(500,600);
v2.setTitle("ESTA ES LA VENTANA DOS");
v2.show();
v2.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e)
{System.exit(0);}});
}
}
class crear extends JFrame
{
public void paint(Graphics g)
{
g.drawString("NUEVA VENTANA CREADA", 40, 50);
}
}
Suscribirse a:
Enviar comentarios (Atom)
0 comentarios:
Publicar un comentario