Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/02/2008, 12:39
Avatar de zempox
zempox
 
Fecha de Ingreso: mayo-2007
Mensajes: 32
Antigüedad: 17 años
Puntos: 1
Re: Formar correcta para JFRAME

Hola bueno no se si es la forma correcta o no pero a mi me funciona :

import java.awt.Dimension;
import javax.swing.JFrame;

public class pruebita{

JFrame Ventana = null;

public pruebita(){
Dimension d = new Dimension();
d.height = 600;
d.width = 800;
Ventana = new JFrame("Ventana de Prueba");
Ventana.setPreferredSize(d);
Ventana.pack();
Ventana.setLocationRelativeTo(null); //Centrar el JFrame
Ventana.setDefaultCloseOperation(JFrame.DISPOSE_ON _CLOSE);
Ventana.setVisible(true);
}


public static void main (String args[]){
pruebita aplicacion = new pruebita();
}

}//fin de la clase pruebita()


espero te sirva..

http://javazempox.blogs.peru.com/