0

Ello, world. I am using Java 7, developing for MacOS Mavericks, and need to go totally fullscreen with window (preferable JFrame). I have set up a class that I can call upon to create a fullscreen window, which works fine for now, but with one caveat: It does not cover up the menu bar along the top of the MacOS interface! I have tried other posts, but none of those replies helped this scenario.

Here is my current FullScreen class:

public class Fullscreen extends Window{

    private static final long serialVersionUID = 1L;

    public Fullscreen() {

        super(new Frame());
        setLayout(new FlowLayout());
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setBounds(0,0,screenSize.width, screenSize.height);

    }

}

I notice that in other answers I've found, the CocoaPods API is necessary, but due to portability concerns, I cannot be using any platform-specific APIs.

SnazzyJava
  • 87
  • 12
  • 1
    http://stackoverflow.com/questions/6873568/fullscreen-feature-for-java-apps-on-osx-lion – Nivas May 13 '14 at 21:35

1 Answers1

1

You can try with JFrame as well

JFrame frame = new JFrame();
JFrame.setDefaultLookAndFeelDecorated(true);
frame.setUndecorated(true);
frame.setAlwaysOnTop(true);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
Braj
  • 46,415
  • 5
  • 60
  • 76