【问题标题】:Programming using Netbeans with GUI使用带有 GUI 的 Netbeans 进行编程
【发布时间】:2012-08-22 19:58:33
【问题描述】:
有没有办法让程序像在 Netbeans 预览设计屏幕中一样显示:
又不像默认的运行程序GUI:
?
【问题讨论】:
标签:
java
swing
user-interface
netbeans
look-and-feel
【解决方案1】:
您是否要设置"look and feel"?
这是链接中的代码:
// Get the native look and feel class name
String nativeLF = UIManager.getSystemLookAndFeelClassName();
// Install the look and feel
try {
UIManager.setLookAndFeel(nativeLF);
} catch (InstantiationException e) {
} catch (ClassNotFoundException e) {
} catch (UnsupportedLookAndFeelException e) {
} catch (IllegalAccessException e) {
}