Determine if full-screen mode is supported directly : Full Screen « 2D Graphics « Java Tutorial

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Main {
  public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    if (gs.isFullScreenSupported()) {
      // Full-screen mode is supported
    } else {
      // Full-screen mode will be simulated

16.47.Full Screen
16.47.1.Full screen mode
16.47.2.Leave full-screen mode (Return to normal windowed mode)
16.47.3.Enter full screen mode
16.47.4.Determine if full-screen mode is supported directly