我刚开始做一个 Snake 游戏,我做了一个 Main 类,我立即做了一个 Display 类。我为他们创建了一个包“Game”,但是当我编译 Main 类时,控制台说它找不到“Display”。
这是主类:
package Game;
public class Main {
public static Display f = new Display();
public static int w = 700;
public static int h = 400;
public static void main( String[] args ) {
f.setTitle(" SNAKE");
f.setSize(w, h);
} // end of method main()
} // end of class Main
这是 Display 类(未完成):
package Game;
import javax.swing.*;
public class Display extends JFrame {
public Display() {
} // end of constructor
} // end of class Display