Issue
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: src="https://i.stack.imgur.com/KtF5p.png" alt="In WindowBuilder" />
What can I do to make it look like the WindowBuilder preview when I start the program?
Solution
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);
}
Answered By - Vinz
Answer Checked By - Cary Denson (JavaFixing Admin)