JFrame.setDefaultLookAndFeelDecorated (true);

when I use the setDefaultLookAndFeelDecorated (true) method in Java why does Frame appear FullScreen when I maximize the frame? and how can I turn off FullScreen mode in this method?

+4
source share
2 answers

Setting setDefaultLookAndFeelDecorated to true causes the scenery to be handled in appearance; this means that the system looks on both Windows and Mac (now I do not have Linux at hand) the border that you expect from your own window, for example, is saved. Staying away from the taskbar in Windows.

When using the look of Cross Platform, aka Metal, which is used by default in Windows, the Windows version will occupy the entire screen, which makes it look like a full-screen window. On Mac OS, refuses to give up its own title and draws the full metal frame (including the title bar) in its own Mac window.

So, in short, if you want to make sure that the taskbar deserves respect, use the Windows system interface in Windows. You can install it using something like

 UIManager.setLookAndFeel((LookAndFeel) Class.forName(UIManager.getCrossPlatformLookAndFeelClassName()).newInstance()); 
+3
source

If you do not want your JFrame to be as high as possible, then .setResizable (false) is called; in the subject.

0
source

Source: https://habr.com/ru/post/1277214/


All Articles