java - Netbeans JFrame initialization; build is fine, but no window is made -


i'm using java, , trying create gui netbeans. i've done before, , i'm puzzled because code, while netbeans doesn't give errors, not produce new jframe window when run in netbeans. however, code initializes jframe identical previous gui-possessing program ("program one"). when try running "program one", works fine. here problem code;

package aircannoncalculator;  import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jtextfield;  public class calcgui extends jframe {  public calcgui(){     settitle("air cannon modeler");     setsize(400,400);     setlocationrelativeto(null);     setdefaultcloseoperation(jframe.exit_on_close); }  public static void main(string[] args){          calcgui gui = new calcgui();         gui.setvisible(true);  } } 

according netbeans, build goes fine, said, no actual window produced. doing wrong?

side note; ignore gratuitous import list.

you have set jframe project's main class, in tab 'project' in name of project(coffee cup icon), right click -> set configuration -> customize -> in section 'run' click on browse button select default main class (your desired jframe), done!


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -