tags:

views:

39

answers:

2

I have a question. I created a new project with netbeans and have main.java and i created a jframe that i called GUI.java. Now when I hit F6, my GUI.java dosen't appear and it runs but nothing shows up cause my main is empty. But if i right click on GUI.java, it shows up the jframe.

How do I go about getting my Jframe working properly to show up when I hit F6?

Thanks in advance.

+1  A: 

The easiest approach is to customize the <default config> combo box and choose your preferred Main Class. Alternatively, you can put your GUI in a JPanel and add() it to a manually created JFrame, as shown in this example.

trashgod
Thank you, this worked very easily. "The easiest approach is to customize the <default config> combo box and choose your preferred Main Class"
RoR
+1  A: 

Also, if you instantiate the JFrame from your main class, you'll need to set this.setVisible(true) in the JFrame constructor

kskjon