[Netbeans][JFrame] - preview diffrent than effect
Hi !
I'm using netbeans 5.5 on windows XP, im tring to write application that is base on JFrame form. Everything seems to be ok but when i looking at preview it is diffrent that effect (compiled application). I like preview because it's simple and compiled application has to many colors :( how to make it tha same as preview ?
Krystian.
I 'm new to Java and had the same issue, after a lot of research I did this.
Create a seperate class (which I named SetUI.class). In that class I created a public method that returns void with no parameters called SystemLook.
/**
* Public SystemLook Method
*/
public void SystemLook() {
/** setLookAndFeel */
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e) {
}
}
In the main method of my first JFrame form I instantiated a new instance of the public SetUI class which I called changeLook. Then, quite simply, invoke the public SystemLook method of the changeLook object.
SetUI changeLook = new SetUI();
changeLook.SystemLook();
Your Java Swing application will now look and feel like a native Win32/MFC app. :-)
That's the way I've done it. Hope this helps.
Message was edited by:
pud1974