im using WindowBuilder to create an UI easily. The problem now: The interface looks different in WindowBuilder and when I run the program as java application. See here:
What can I do to make it look like the WindowBuilder preview when I start the program?
CodePudding user response:
You can alter the overall look of your app by setting a Look and Feel.
try {
for (javax.swing.UIManager.LookAndFeelInfo laf : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Classic Windows".equals(laf.getName())) {
javax.swing.UIManager.setLookAndFeel(laf.getClassName());
break;
}
}
} catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException |
IllegalAccessException e) {
throw new RuntimeException(e);
}