繁体   English   中英

Eclipse Window Builder的出现

[英]Eclipse Window Builder appearence

我正在通过编写此应用程序并在Window Builder中进行编辑来学习Java Swing,但是我看到的是运行该应用程序时的外观与我在Window Builder中编辑的外观不同。 具体来说,我更喜欢Window Builder中的那个。 我在Window Builder中检查了某种外观,然后选择了“ Nimbus”。 我可以做些什么使应用程序看起来像在Window Builder中运行时一样吗? 我正在使用Eclipse。

第一个是在Window Builder中进行测试,第二个是在运行应用程序时。

在Window Builder中测试

当我运行应用程序时

您可以在Swing应用程序中激活不同的外观:

http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html

我想多数民众赞成在您正在运行的应用程序中丢失。

import javax.swing.UIManager.*;

try {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            break;
        }
    }
} catch (Exception e) {
    // If Nimbus is not available, you can set the GUI to another look and feel.
}

您的问题已经在这里回答

在Eclipse中,转到

窗口>首选项> WindowBuilder>摇摆> LookAndFeel

并检查

在main()方法中应用选择的LookAndFeel。

暂无
暂无

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

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