Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Fullscreen for desktop application (yet another :))

843807Mar 20 2010 — edited Mar 21 2010
Hi,

I'm trying to get a working fullscreen option for my desktop application like "F11 key" pressed on chrome or firefox. I tried many solutions found around google or even this forum although without any success. At the moment my code is:
private Rectangle bounds;

....
if (_fullscreen) enterFullScreen();
else exitFullScreen();
....


private void enterFullScreen() {
        this.bounds = getBounds();
        setResizable(false);
        final Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        setSize(dim.width, dim.height);
        setLocation(0,0);
    }

    private void exitFullScreen() {
        setResizable(true);
        setSize(bounds.width, bounds.height);
        setLocation(bounds.x, bounds.y);
    }
and all I get is a maximized window.
Have you any idea how to get a "real" fullscreen?

Thanks,
Julio
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2010
Added on Mar 20 2010
4 comments
225 views