Java swing, close one window and open another when button is clicked
public void close()
{
this.setVisible(false);
this.dispose();
//WindowEvent w=new WindowEvent(this,WindowEvent.WINDOW_CLOSING);
//Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(w);
}