I am having an issue. My JFrame starts with contents inside of it, but displays transparently with the contents on top.
package javagame;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;
public class JavaGame extends JFrame{
public JavaGame(){
setTitle("Java Game");
setSize(500, 500);
setResizable(false);
setVisible(true);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void paint (Graphics g){
g.drawString("Hello World!", 250, 250);
}
public static void main(String[] args){
new JavaGame();
}
}
Help is appreciated! (: