-1

I'm using NetBeans to write a Java Project. When I tell NetBeans to open the form as the Main Class it opens it like this:

http://dl.dropbox.com/u/12868212/Good.jpg

But I want to use a specific Main Class that I wrote, which calls the constractor of the aforementioned form and I get:

http://dl.dropbox.com/u/12868212/Bad.jpg

The constructor code:

public class Main {

 /**
  * @param args the command line arguments
 */
 public static void main(String[] args) {

     //Updating Global Variables Class:
     GlobalVariables.Update_Global_Variables_From_Configuration_XML(); 

     Form_StudentPresentation form_StudentPresentation = 
                                    new Form_StudentPresentation();

     form_StudentPresentation.setVisible(true);
 }

Can someone tell me what is wrong? How can i call the constractor in the main so that the form will look like the Good.jpg?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Aviadjo
  • 635
  • 5
  • 17
  • 36
  • 1
    Perhaps you want to override the look&feel? I'm surprised NetBeans do that. – John Dvorak Jan 10 '13 at 19:47
  • What is in Form_StudentPresentation's main() function? I.e. how is the form created in the 1st case? – frozenkoi Jan 10 '13 at 20:07
  • Netbeans, by default, will want to use the "default" look and feel, which is Nimbus if it's installed. If you've used one of the Netbeans templates, this will be done automatically for you. If not, you will have to set the look and feel manually. Check out [How to set the Look and Feel](http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html) – MadProgrammer Jan 10 '13 at 20:13
  • 1) Stop talking NetBeans and start talking Java. If you mean a `JFrame` say that instead of a 'form' 2) Read the description of tags before slapping them on posts. [tag:forms] is for **HTML** forms! – Andrew Thompson Jan 11 '13 at 02:58

1 Answers1

1

I think forms/frames created with Netbeans have look and feel code by default.

Check if the lookAndFeel setter is being called inside your class, or in a main inside your form.

You could also check if you have any look and feel specification as running arguments in your project settings.

Adrián
  • 6,135
  • 1
  • 27
  • 49