My JFrame appears and disappears
Hello,
I've started a simple java application, it is a JFrame with a JLabel.
so when I execute it (I'm using ant), the JFrame appears and dissapears.
This is my piece of code:
publicclass Isp1extends JFrame{
Isp1()
{
super("Hola");
}
publicvoid inicia(){
JLabel l=new JLabel("HOLA");
this.getContentPane().setLayout(new BorderLayout());
this.addWindowListener(new WindowAdapter(){
publicvoid windowClosing(WindowEvent e)
{
System.exit(0);
}
});
this.getContentPane().add(l, BorderLayout.CENTER);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE );
}
publicstaticvoid main(String args[]){
Isp1 p=new Isp1();
p.inicia();
p.pack();
p.setVisible(true);
}
}
If I use JDialog everything runs right.

