Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am try to do 100% full screen mode, I am using Ubuntu 12.10, and on the left is the side bar and the top is the menu. When I run full screen mode it doesn't cover up those two menu bars, it sits next to them:

Screen Shot

It should cover the left menu bar and the top black bar. Anyone have any idea why it doesn't?

package sscce;

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import javax.swing.JFrame;

public class Main extends JFrame{

    public Main(){
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice myDevice = ge.getDefaultScreenDevice();

    public static void main(String[] args){
        Main main = new Main();
share|improve this question

This is the expected behaviour. setFullScreenWindow sends a request to the OS, which returns the dimensions of the desktop: the area to the right of the launcher and beneath the menu bar.

My background is in Windows development (although I'm now learning Linux development as fast as I can), so I can't give precise details how on to change your code. But in Windows you would need various Win API calls, plus native interface through JNI/JNA, to do this. For a good article on this issue in Unity, see

If this is an app for personal use, you should of course do whatever you want. But if you are developing for other people, may I respectfully say that it's generally not a good idea to override this behaviour. How the desktop works should be viewed as a contract. Users would likely be confused and frustrated by an app that covered up their expected way of controlling their desktop.

share|improve this answer
This is actually a gaming library which has 2 options, 1) window mode. 2) full screen mode. setFullScreenWindow actually gets the desktop width/height, including the launcher and the menu bar and makes the window that big, but then slides it down and to the right so some of the application is now off screen. – Get Off My Lawn Dec 30 '12 at 15:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.