-2

Hey I coded a calculator. In the design Tab I set it to Windows but wehn I export it, its the nasty "Metal" theme. And it dosnt look like i designed it. Sincerely Jonathan

The Eclipse View

When I export it

Zoe
  • 27,060
  • 21
  • 118
  • 148
Jonathan
  • 76
  • 7
  • You do need to set the desired Look&Feel within the application itself. If one isn't provided and the application is run in Windows then it **should** default to Windows L&F. There are two common Windows L&F's, `Windows` and `Windows Classic`. – DevilsHnd - 退職した Sep 21 '20 at 22:08
  • If you found a solution please create an answer instead of editing the question to indicate it. – Yunnosch Sep 22 '20 at 12:51
  • "it dosnt look like i designed it" Sure does. It has the same typo. – Yunnosch Sep 22 '20 at 12:52

1 Answers1

0

The solution is:

First you need to go to: Window > Preferences > WindowBuilder > Swing > LookAndFeel

Then you tick Windows > Apply & Close

public static void main(String[] args) {
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch(Exception e) {
        System.out.println("Error setting native LAF: " + e);
    }
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            try {
                YourFrame frame = new YourFrame();
                frame.setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}
Jonathan
  • 76
  • 7