java - Can't call UI classes with netbeans GUI builder -


Working on learning the GUI builder for Netbeen, and I am very confused I write a basic LoginUI class with the GUI Builder If I run the class on a standalone basis, then the window pops up like what I expect, though it does not happen if I try to make a new example of it. My flow of control is as follows:

  public static zero main (string [] args) {log inkal theLoginCntl = new LoginCntl (); } Public class LoginCntl {public LoginCntl} (login UI the loginUI = new login UI}}  

}

  public login UI () {initComponents (); System.out.println ("Are we here?"); // It prints, so I know that the program goes here. The problem is that the window does not appear here) Java.awt .EventQueue.invokeLater (New Runnabal) (Public Running Zero () (New Login UI) Set Usable (True);}});  

I'm not really sure that I why alone I can get the window and then, when I make it a new example then the window is not visible. I feel that I am missing something very basic, any kind of help will be welcomed.

EDIT: Added some extra generated code which provides Netbeen. This call set is being said, while looking for Set Visible () I saw that the GUI Builder Added some of its generated code as far as I know that you have only one main project in 1 project. Must be square. Could this be my problem?

If you never set any view, in fact, it is impossible to determine if Your UI actually has a window to display.

If the login UI extends from something to JFrame , then you should call ...

  theLoginUI.pack (); TheLoginUI.setVisible (true);  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -