single document interface, start a new JFrame in a new thread
i decided to have my java application use the single document interface (SDI) approach. my problem is how to start a new JFrame application from an existing one. below is some simple code that does NOT work. please help.
public class MyGuiForm extends JFrame implements ActionListener {
private JButton _btnNew;
public MyGuiForm() {
_btnNew = new JButton("New");
this.getContentPane().setLayout(new BorderLayout());
this.getContentPane().add(_btnNew);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.pack();
this.show();
}
public void actionPerformed(ActionEvent ae) {
Object source = ae.getSource();
if(null == source) return;
if(_btnNew == source) {
new MyGuiForm();
}
}
/**
* @param args
*/
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame.setDefaultLookAndFeelDecorated(true);
new MyGuiForm();
}
});
}
}

