这是主要课程
package com.First.Game;
import javax.swing.JFrame;
public class main {
public static Display f = new Display();
public static int width =600;
public static int height = 400;
public static void main(String args[]){
f=new Display();
f.setSize(width, height);
f.setResizable(false);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setTitle("Sticky Zombies");
f.setLocationRelativeTo(null);
System.out.println("STICKY ZOMBIES is running on a main window");
}
}
这是类显示
package com.First.Game;
import javax.swing.*;
public class Display extends JFrame{
public main panel;
public Display(){
panel= new main(this);
}
}
我是初学者,我真的需要帮助我基本上完全从我所看到的和我观看的视频中复制了一些代码,他可以完美地运行它(这不是我观看的完整代码)