making java SingleFrameApplication to appear second

Posted by Karel Bílek on Stack Overflow See other posts from Stack Overflow or by Karel Bílek
Published on 2010-03-28T01:05:58Z Indexed on 2010/03/28 1:13 UTC
Read the original article Hit count: 401

Filed under:
|

Sorry if this question will sound too chaotic, feel free to edit it.

I have an application made entirely in netbeans, which uses SingleFrameApplication and auto-generated the GUI code, named "MyApp", and FrameView, named "MyView". Now, the MyApp somehow has the main() function, but the MyView has all the graphic elements..

I don't entirely understand how that happens, so used it as black box (it somehow created the window, I didn't have to care why). But now, I need the window to be only a window, opened by another JFrame. I don't know, how to accomplish that.

MyApp, which is extending SingleFrameApplication, have these methods:

public class MyApp extends SingleFrameApplication {

    @Override protected void startup() {
        show(new MyView(this));
    }

    @Override protected void configureWindow(java.awt.Window root) {
    }

    public static MyApp getApplication() {
        return Application.getInstance(MyApp.class);
    }

    public static void main(String[] args) {
       launch(MyApp.class, args);

    }
}

MyView has these methods:

public class MyView extends FrameView {

    public MyView(SingleFrameApplication app) {
        super(app);
        initComponents();
    }
    private void initComponents() {
        //all the GUI stuff is somehow defined here
    }
}

Now, I have no clue how the two classes work, I just want this window, defined in MyView, to appear after another window, "ordinary" JFrame. How can I call this MyApp/MyView?

© Stack Overflow or respective owner

Related posts about java

Related posts about awt