I have been looking over the internet (expescially StackOverflow of course :) ) for the following issue. Netbeans offers a 'great' default look and feel, so i want to change that to a native look. With this I mean, the running program doesn't look equal to the designed GUI. So when youre designing on a Windows pc, the program looks like Windows, and so for Mac etc.
So, I searched on this website, found a lot of times an example code like this:
private void setLookAndFeel() {
// Get the native look and feel class name
String nativeLF = UIManager.getSystemLookAndFeelClassName();
try {
UIManager.setLookAndFeel(nativeLF);
} catch (ClassNotFoundException | InstantiationException |
IllegalAccessException | UnsupportedLookAndFeelException ex) {
Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
}
}
source: http://www.exampledepot.com/egs/javax.swing/LookFeelNative.html
But... it wont work for me.
I 'll get a nullpointerexception, that is very long (584 lines).
I hope someone can help me.
Thanks in advance!
Dave
Backgroundinformation: - Netbeans 7.1.2 - Windows 7 - wont work like this: http://www.exampledepot.com/egs/javax.swing/LookFeelNative.html