简体   繁体   English

Windowbuilder 中的窗口样式

[英]Windows style in Windowbuilder

Hey I coded a calculator.嘿,我编写了一个计算器。 In the design Tab I set it to Windows but wehn I export it, its the nasty "Metal" theme.在设计选项卡中,我将其设置为 Windows,但在导出时,它是令人讨厌的“金属”主题。 And it dosnt look like i designed it.它看起来不像我设计的。 Sincerely Jonathan真诚的乔纳森

The Eclipse View日食视图

When I export it当我导出它

The solution is:解决办法是:

First you need to go to: Window > Preferences > WindowBuilder > Swing > LookAndFeel首先你需要去:Window > Preferences > WindowBuilder > Swing > LookAndFeel

Then you tick Windows > Apply & Close然后你勾选 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();
            }
        }
    });
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM