package com.BickDev.Game;
import java.awt.Canvas;
import java.awt.Dimension;
import javax.swing.JFrame;
public class Game extends Canvas implements Runnable {
private static final long serialVersionUID = 1L;
public static final int WIDTH = 320;
public static final int HEIGHT = WIDTH / 12 * 9;
public static final int SCALE = 2;
public final String TITLE = "Troy's Game Test";
private boolean running = false;
public void run() {
}
public static void main(String args[]) {
Game game = new Game();
Dimension size = new Dimension(WIDTH * SCALE, HEIGHT * SCALE);
game.setPreferredSize(size);
game.setMaximumSize(size);
game.setMinimumSize(size);
JFrame frame = new JFrame(game.TITLE);
}
}
导入 javax.swing.JFrame 现在出现错误
Access restriction: The type JFrame is not accessible due to restriction on required library C:\ProgramFiles\Java\jre8\lib\rt.jar