Tip: "Unset as Main Project"
By Geertjan on Nov 07, 2011
A strange thing to get used to in NetBeans is when you're in this situation:
Above, the "GUIFormExamples" project is bold, i.e., it is the main project. Hence, when "Run Main Project" (and other "Main Project" buttons) is clicked in the toolbar, the "GUIFormExamples" is run, even though the "AnagramGame" project is currently selected.
Wouldn't it be better if the currently selected project were to be the main project? The whole concept of a "main project" is needlessly confusing. The main project should simply be the currently selected project and if the cursor is currently in an editor document, then the related project should automatically be the main project.
Now here's a simple workaround to achieve the above (thanks to developers in Norway who told me about this): right-click the "GUIFormExamples" above and choose "Unset as Main Project". Now there are no main projects and the currently selected project is run when you choose "Run Main Project" and, similarly, when an editor document is open, the related project is run.
A related issue: http://netbeans.org/bugzilla/show_bug.cgi?id=166780