Top panel is shown over full Screen window for Java Apps
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Unity |
Confirmed
|
Low
|
Unassigned | ||
unity (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
When I try to use this simple Java code which fill screen by red color. At the top of the screen still view Unity panel (like Gnome panel).
// Code example
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.
import java.awt.
import java.awt.Toolkit;
import java.awt.
import java.awt.
import javax.swing.
import javax.swing.
import javax.swing.
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.
public class ScreenTest extends JFrame {
ScreenTest() {
setUndecorate
setResizable(
Dimension screenSize = Toolkit.
add(new TestPanel(
// Close application when pressed Esc
getRootPane(
public void actionPerformed
}
});
}
public static void main(String[] args) {
GraphicsDevice device = GraphicsEnviron
ScreenTest frame = new ScreenTest();
device.
frame.
}
}
class TestPanel extends JPanel {
Dimension screenSize;
TestPanel(
this.screenSize = screenSize;
setOpaque(true);
setBackground
setBorder(
setPreferredS
}
public void paintComponent(
super.
g.setColor(
g.fillRect(0, 0, screenSize.width, screenSize.height);
}
}
Changed in unity: | |
importance: | Undecided → Low |
Changed in unity (Ubuntu): | |
importance: | Undecided → Low |
Confirmed. But I'm not sure this is a bug in unity or in openjdk. Smaller code that reproduces this bug:
import java.awt.Color; GraphicsEnviron ment;
import java.awt.
import javax.swing.JFrame;
public class ScreenTest extends JFrame {
ScreenTest() { d(true) ; e().setBackgrou nd(Color. RED); seOperation( EXIT_ON_ CLOSE);
setUndecorate
getContentPan
setDefaultClo
setVisible(true);
}
public static void main(String[] args) { onment. getLocalGraphic sEnvironment( ).getDefaultScr eenDevice( ).setFullScreen Window( new ScreenTest());
GraphicsEnvir
}
}