19

Possible Duplicate:
Java Fullscreen mode not working on Ubuntu

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. Why doesn't it?

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();
        this.setUndecorated(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        myDevice.setFullScreenWindow(this);
    }

    public static void main(String[] args){
        Main main = new Main();
    }
}
Community
  • 1
  • 1
Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338
  • 17
    +1 for the SSCCE and screenshot, I wish everyone did that. – Brian Dec 21 '12 at 21:00
  • So `setUndecorated(false);`? Ts, ts. – Joop Eggen Dec 21 '12 at 21:12
  • 1
    For the record, the more applicable answer in the linked duplicate is [this one](http://stackoverflow.com/a/12522862/646634). Also, since the "possible duplicate" comment got deleted, here's [the other link](http://stackoverflow.com/a/8838884/646634) that gives a more in-depth explanation of the problems faced in full screen Linux Java development. – Brian Dec 21 '12 at 21:21
  • 1
    @Brian: For reference, the [answer](http://stackoverflow.com/a/12522862/646634) you cited was recently (and justifiably) deleted by a moderator, as it did little more than refer to this more useful [answer](http://stackoverflow.com/a/7457102/230513). – trashgod Dec 21 '12 at 21:58
  • @trashgod Hm, ironically, I believe that was your answer :) But thanks for the update. – Brian Dec 22 '12 at 00:15

0 Answers0