Yet another Java programming question

I have yet another stoooopid Java programming question.

I’ve been attributing my problems to date on my unfamiliarity with build procedures and XML scripts. I’ve been developing with NetBeans, and if I hit the Build option on the menu, everything would compile and so on, but no dialog would open up when I tried to run or debug. To do what I wanted, I’d have to select the main dialog directly and run or debug it.

Well, yesterday it finally struck me what was really going on. I’ve been working in the MainFrame and dependent files, and paid 0 attention to Main. It is a placeholder, and had no code in it. DOH! :smack: I have to admit to being spoiled by Visual Studio, which will provide a simple Main with enough functionality to open the equivalent of the MainFrame class.

I’ve spent a couple of hours now looking for a Java tutorial that uses a simple GUI as an example of what I need to do to open up my dialog. Anyone out there able to point me in the right direction, either by example, or telling me directly what I need to do?

Bump.

Found an example that I’m going to try. Stand by…

I’ve never used netbeans, but usually all you need to get a window (JFrame) visible is:

MainFrame f = new MainFrame();
f.pack(); // This sizes the window based on the layout/children
f.setVisible(true);

The assumption here is that the constructor creates all the GUI elements (normally what I do). Otherwise you may need to stick a call to create() or something else before pack().

w00t! It finally works!

c_goat, I had to ad the SetVisible from your reply to the example I had to get everything working. A big thanks to you.