java NetBeans平台和TinyLaF 1.4.0
我正在使用TinyLaF库定制我的NetBeans平台应用程序的外观。TinyLaF也在我的主窗口的框架上作画。当我运行(执行)应用程序时,它有时会绘制框架,有时不会。我不知道我做错了什么。以下是我的Installer类中扩展ModuleInstall的代码:
public class Installer extends ModuleInstall {
@Override
public void restored() {
//Set the global LookAndFeel of the application
try {
// continuous layout on frame resize
Toolkit.getDefaultToolkit().setDynamicLayout(true);
// no flickering on resize
System.setProperty("sun.awt.noerasebackground", "true");
// to decorate frames
JFrame.setDefaultLookAndFeelDecorated(true);
// to decorate dialogs
JDialog.setDefaultLookAndFeelDecorated(true);
File themeFile = InstalledFileLocator.getDefault().locate("Default.theme", "myapp.main", false);
Theme.loadTheme(themeFile);
UIManager.setLookAndFeel(new TinyLookAndFeel());
//Remove the tab from Editor section - using the code from
//Geertjan's Netbeans platform tutorials
UIManager.put("EditorTabDisplayerUI", "myapp.main.NoTabsTabDisplayerUI");
SwingUtilities.updateComponentTreeUI(frame);
} catch (HeadlessException | UnsupportedLookAndFeelException ex) {
}
}
}
共 (0) 个答案