Thursday 15 April 2010

java - Making JFrame fullscreen in Ubuntu/Unity -


In Ubuntu (actually in unity), I can not do fullscreen of swing gefram I try several methods written in stackoverflow But none of them works for me.

I am trying to develop a game and I should not see anything on my game, but my game on my screen. However, Ubuntu forces me to display the Integration Launcher and the Menubar (clock, WiFi icon, etc.).

How do I run my Java program in full screen mode? Here is my code:

  Import java.awt.GraphicsDevice; Import java.awt.GraphicsEnvironment; Import javax.swing.JFrame; Public Class Starter Expands JFrame {Private Static Last Long Serial VERSIONUID = -2656706278597877008L; Public stationary zero main (string [] args) {new starter (); } Public Starter () {Super (UIConstants.FRAME_TITLE); SetResizable (wrong); SetDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); SetUndecorated (true); MakeFullScreen (); SetVisible (true); } Private Zero MacFullscreen () {Graphics Environment NV = Graphics Environment. Geolocal Graphics Environment (); Graphics Device Device = env.getDefaultScreenDevice (); Device.setFullScreenWindow (this); }}   

And this program is seen as follows: Program Output

You can not delete the global menu or put a window on it, just go to the theme Like the other: lxde

No comments:

Post a Comment