Вы можете попробовать что-то вроде:
import javax.swing.*;
import java.awt.*;
public class FullScreenTest extends JFrame {
private GraphicsDevice device;
private boolean isFullScreen = false;
public FullScreenTest(GraphicsDevice device) {
super(device.getDefaultConfiguration());
this.device = device;
setTitle("Display Mode Test");
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
private void initComponents(Container c) {
setContentPane(c);
c.setBackground(Color.RED);
}
public void begin() {
isFullScreen = device.isFullScreenSupported();
setUndecorated(isFullScreen);
setResizable(!isFullScreen);
if (isFullScreen) {
// Full-screen mode
device.setFullScreenWindow(this);
validate();
} else {
// Windowed mode
pack();
setVisible(true);
}
}
public static void main(String[] args) {
GraphicsEnvironment env = GraphicsEnvironment.
getLocalGraphicsEnvironment();
GraphicsDevice[] devices = env.getScreenDevices();
FullScreenTest test = new FullScreenTest(devices[0]);
test.initComponents(test.getContentPane());
test.begin();
}
}