Original Post
Hey everyone. I'm new to this forum and new to Java in general. I'm hoping to get into some Java game programming as a hobby. I recently made a simple applet game and would like to turn it into a fullscreen application but I'm having some problems. My class signature looks like this
public class BallBuster extends JFrame implements Runnable, MouseListener, KeyListener, ActionListener, ItemListener
I'm getting a fullscreen window like this
(in constructor)
//Set up the display mode
DisplayMode displayMode = new DisplayMode(1024, 768, 32, 75);
//Get the graphicsDevice
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
device = environment.getDefaultScreenDevice();
//Set JFrame to fullscreen window
device.setFullScreenWindow(this);
//Set display mode
device.setDisplayMode(displayMode);
I'm able to draw on the window just fine but I'm having problems placing Swing components in the window. I want to have a Start button and some radio buttons for difficulty level before the game starts along with with some primitive drawn text. If I add a button like this in my constructor //Set up button FlowLayout layout = new FlowLayout(); device.getFullScreenWindow().setLayout(layout); device.getFullScreenWindow().add(new JButton("START")); the button is drawn then immediately covered by my primitive drawing code in the paint() procedure. Can anyone help me out? Thanks