Reputation: 4267
I've been asked to modify a java desktop application (I've never worked on java desktop application).
I have been gaven the project that I opened with Netbeans 8.0.2. Something weird happens.
If I launch the app from Netbeans (after doing "clean and build") with right click on the project - > run I get this look and feel:
If I launch the app from command line with java -jar C:\Users\...\NetBeansProjects\Clean\appaName.jar
I get this look and feel (that is the correct one, since it is the look and feel of my OS, windows 10):
As you can see from the pics below, on Netbeans the Runtime Platform and JRE seem to be correclty set.
Does anybody know why? Be patience, I've never worked on desktop aplication.
Thank you
Upvotes: 3
Views: 145
Reputation: 109547
Initialize the look & feel to the System one. (Though I like "Nimbus" more.)
This should best be done in the beginning.
public static void main(String[] args) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
...
}
Look in the NetBeans generated code for a main
; as look&feel code might well be generated too.
Upvotes: 3