简体   繁体   English

JFrame更改边框颜色

[英]JFrame Change Border Color

Hey ho everybody I need some help I want to change the Color from my JFrame I know that I can remove the border with "setUndecorated(true)" but now I want to customize this Border. 嗨,大家好,我需要一些帮助,我想从JFrame更改颜色,我知道我可以使用“ setUndecorated(true)”删除边框,但是现在我想自定义此边框。 Are there any methods to customize my JFrame border?? 有什么方法可以自定义我的JFrame边框吗? Thank you for your help. 谢谢您的帮助。

You can use a LAF: 您可以使用LAF:

try {
        // Set cross-platform Java L&F (also called "Metal")
    UIManager.setLookAndFeel(
        UIManager.getCrossPlatformLookAndFeelClassName());
} 
catch (UnsupportedLookAndFeelException e) {
   // handle exception
}
catch (ClassNotFoundException e) {
   // handle exception
}
catch (InstantiationException e) {
   // handle exception
}
catch (IllegalAccessException e) {
   // handle exception
}

this wil use the default look and feel for youre divice. 这将为您的设备使用默认外观。 You can download custom lafs from the web 您可以从网上下载自定义标签

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

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