java – 如何设置jframe外观
作者:互联网
我有点困惑在哪里把这个:
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch(Exception e){
}
我没有扩展JFrame类但使用了JFrame f = new JFrame();
感谢:D
解决方法:
放置它的最常见的地方就在你的静态void main(String [] args)方法中.
像这样:
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch(Exception ignored){}
new YourClass(); //start your application
}
有关更多信息,请访问此站点:
http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
标签:uimanager,look-and-feel,java,swing,jframe 来源: https://codeday.me/bug/20190929/1830473.html