hey everyone,
I'm busy with java programming since a little while, and now i want to make a game, but i stumbled upon two problems:
there's something wrong with the title of of the window the game will be shown in, and theres a problem with my public static void main
error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at GameFrame.main(GameFrame.java:33)
screenshot:
hwi.jpg
my code:
import javax.swing.*; import java.awt.*; public class GameFrame extends JFrame { public static String title = "Tower Defense Alpha - \"Java Game!"\""; public static Dimension size = new Dimension(700, 550); public GameFrame() { setTitle(title); setSize(size); setResizable(false); setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); init(); } public void init() { setLayout(new GridLayout(1, 1, 0, 0)); GameScreen Screen = new GameScreen(); add (Screen); setVisible(true); } public static void main(String args[]) { Frame frame = new Frame(); } }
if anybody can help me, please do it