问题描述
嘿,我为计算器编码。在设计选项卡中,我将其设置为Windows,但是我导出了它,这是讨厌的“金属”主题。而且它看起来并不像我设计的那样。真诚的乔纳森
解决方法
解决方案是:
首先,您需要转到:窗口>首选项> WindowBuilder> Swing> LookAndFeel
然后您勾选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();
}
}
});
}