各位大佬有人能帮我看看这个代码有什么问题吗?
package cn.de.k;import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* 游戏窗口
*/
import javax.swing.JFrame;
public class WbicCaod extends JFrame{
Image nusm=GameUtil.getImage("jvth/nusm.jpg");
Image jtpw=GameUtil.getImage("jvth/jtpw.jpg");
//绘制图形
public void paint(Graphics g) {
g.drawImage(nusm, 250,250, null);
g.drawImage(jtpw, 500, 300, null);
}
//创建主窗口
public void launchFrame() {
this.setTitle("标题");
this.setVisible(true);//显示窗口
this.setSize(500,500);//窗口大小
this.setLocation(300,300);//窗口位置
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
public static void main(String[] args) {
WbicCaod a =new WbicCaod();
a.launchFrame();
}
}