Java - Screen turns black, when setting a JFrame to Fullscreen
I'm trying to draw something on a Canvas, add it to a JFrame and then set this JFrame to Fullscreen. My problem is: in fullscreenmode I only see a black screen. Before the screen turns black I shortly can see the pink background of the canvas. Drawing directly on a JFrame and then setting it to fullscreen works perfectly fine and I can see the testtext. I assume there is a problem with displaying the Canvas properly. Here is my code: public class FullscreenTest extends Canvas { private JFrame mainFrame; public FullscreenTest(){ this.mainFrame = new JFrame(); JPanel contentPane = (JPanel)