So I'm using Ubuntu and when I want to enter fullscreen mode in Java, a normal window appears with max screen size, instead of a fullscreen window without title bar etc. I admit, I'm not even sure what the fullscreen mode should look like in Java, because I have not tried it on any other OS. But I assume it should be a screen without title bar.
Anyone else who has this problem?
This is the code I use. ; pretty straight forward.
public static void main(String[] args) {
GraphicsEnvironment env = GraphicsEnvironment
.getLocalGraphicsEnvironment();
GraphicsDevice vc = env.getDefaultScreenDevice();
JFrame window = new JFrame();
window.setUndecorated(false);
window.setResizable(false);
vc.setFullScreenWindow(window);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…