I am currently working on an intro screen for a game designed using JOGL. I want the intro to be a JPanel with a few buttons to alter options before starting the game.
So, I have JFrame which I add a GLCanvas to. The GLCanvas also contains a GLEventListener. Finally, I add the JPanel.
I have overridden the JPanel paintComponent method to set a background image. I have a few buttons within the panel. Whenever you click the 'play' button, it calls a function which does:
frame.remove(JPanel); frame.repaint(); animator.start();
What happens is that my JPanel goes away correctly, but when repaint is called, my frame is just filled with grey. I know that the animator is starting correctly as the display method in my GLEventListener is getting called.
Does anyone know what the problem is there?