how to make frame undecorated after jTattoo theme installed

[亡魂溺海] 提交于 2019-12-01 05:59:09

问题


after using 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); 
     }
}

i still want to make all the frames undecorated.i tried to use

this.undecorated(true);

in constructor of my frame but these codes won't work since the look and feel overrides these codes, can anyone tell me how to go above this?? any help would be much appriciated.


回答1:


I had the same problem and because this API is not enough documented it may be difficult to figure out how to solve this.

The problem comes because the theme overides the standard application bar so the theme has to hide it too. I spent few minutes looking through classes code and I found out this solution. After you set the look and feel if you want to go in fullscreen mode, first you have to remove the border. So before setting:

this.undecorated(true);

remove the borders:

DecorationHelper.decorateWindows(false);

P.S before leaving fullscreen you have to redecorate the window:

DecorationHelper.decorateWindows(true);

It worked for me!



来源:https://stackoverflow.com/questions/38341856/how-to-make-frame-undecorated-after-jtattoo-theme-installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!