I have a problem with full-screen : i create a frame and put it in a full-screen Window but i see nothing but the color of the frame's background.
here is the code i used:
PB frame = new PB();
win = new Window(frame);
gs.setFullScreenWindow(win);
frame.setVisible(true);
frame.repaint();
win.repaint();
and the PB class, my frame:
public class PB extends JFrame
{
PB()
{
super();
this.setBackground(Color.BLUE);
this.getContentPane().add(new JButton("button"));
JPanel jp = new JPanel();
jp.setBackground(Color.red);
jp.setSize(360, 200);
this.getContentPane().add(jp);
this.setVisible(true);
repaint();
pack();
}
@Override
public void paint(Graphics g)
{
Graphics2D g2d = (Graphics2D)g;
g2d.setPaint(new Color(0,0,0));
g.fillRect(0,0,200,200);
}
}
So all i can see, is a big screen with the background color (here blue);
Thanks for all help