I want to make a GUI project with several forms. I've created a desktop application, and there're 3 classes: main application class, main window, and About box. Only the application class has main method.
Now I want to add a new form which will be shown after a button click. I create New File -> Swing GUI Forms -> JFrame Form, and I get a new form, with main() method. If I copy the generated code for About box, everything works fine, but I'm confused about what is the proper way to show this form when I click a button.
Code to show About box:
Java Code:
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = DeskTestApp.getApplication().getMainFrame();
            aboutBox = new DeskTestAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        DeskTestApp.getApplication().show(aboutBox);
    }
Code of NewJFrame.main():
Java Code:
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new NewJFrame().setVisible(true);
            }
        });
    }