This " LookAndFeel " is Nimbus, which netbeans automatically configures when you are using the graphing tool it has. To change the LAF (LookAndFeel), just go in the code of main
, and find this section here:
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
Changing the if line to:
if ("Windows".equals(info.getName()))
or even
if ("Windows Classic".equals(info.getName()))
The first style will try to adapt the appearance to the current version of windows that is running the application, the second will try to adapt to a classic version, similar to windows 98.
It is possible to remove that for
loop within try/catch
, and make the call below, which will invoke the system theme currently used:
try {
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
Remember that if you run your application in some OS different from windows, java will change to the theme "Metal", which is the only "cross platform" theme that comes embedded in the JDK. In order to look like windows regardless of system, you may need to create your own LAF
In this link there is a list of other LAF's existing in java-swing.