[英]JFrame hiding windows taskbar when maximized and sets undecorated
I'm having an issue with JFrame
, when i set my undecorated = true
, and it's maximized, it turns the JFrame
to full screen mode, hiding the Windows taskbar. 我在使用
JFrame
时遇到问题,当我将undecorated = true
设置为最大化时,它将JFrame
变为全屏模式,从而隐藏了Windows任务栏。 Is there any way to work around it without set undecorated = false
? 没有设置
undecorated = false
方法是否可以解决?
// Gets the screen resolution
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
// Gets the width and height
double width = screenSize.getWidth();
double height = screenSize.getHeight();
// Subtract height of taskbar from height in my case 50
frame.setSize((int)width, (int)height - 50);
frame.setLocationRelativeTo(null); // Set frame at center of the screen
frame.setUndecorated(true); // Removes title bar
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.