【问题标题】:how to make frame undecorated after jTattoo theme installed安装jTattoo主题后如何使框架不装饰
【发布时间】:2016-08-03 14:11:06
【问题描述】:

使用jTattoo LookAndFeel后,

try {
       UIManager.setLookAndFeel(new McWinLookAndFeel());
       new Main(new UserModel()).setVisible(true);

     } catch (UnsupportedLookAndFeelException ex) {
       Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null,ex); 
     }
}

我还是想让所有的框架都没有装饰。我尝试使用

this.undecorated(true);

在我的框架的构造函数中,但这些代码不起作用,因为外观会覆盖这些代码,谁能告诉我如何超越这个? 任何帮助将不胜感激。

【问题讨论】:

    标签: java look-and-feel uimanager


    【解决方案1】:

    我遇到了同样的问题,因为这个 API 没有足够的文档记录,可能很难弄清楚如何解决这个问题。

    问题来了,因为主题覆盖了标准应用程序栏,所以主题也必须隐藏它。我花了几分钟浏览类代码,发现了这个解决方案。如果您想进入全屏模式,设置好外观后,首先您必须删除边框。所以在设置之前:

    this.undecorated(true);
    

    移除边框:

    DecorationHelper.decorateWindows(false);
    

    P.S 在离开全屏之前,您必须重新装饰窗口:

    DecorationHelper.decorateWindows(true);
    

    它对我有用!

    【讨论】:

    • DecorationHelper.decorateWindows(false); this.setUndecorated(true); this.setAlwaysOnTop(true); DecorationHelper.decorateWindows(true); this.setExtendedState(this.MAXIMIZED_BOTH); @Alin 你的意思是这样的??不幸的是,它对我没有用。我犯了什么错误吗??
    • @Azela 不。在启动用于全屏模式的类之前,您必须调用方法DecorationHelper.decorateWindows(false);。示例:DecorationHelper.decorateWindows(false); new FullScreenClass();
    猜你喜欢
    • 1970-01-01
    • 2011-07-09
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 2015-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多