java加载不了背景图片? 5
packagecn.bjsxt.solar;importjava.awt.Graphics;importjava.awt.Image;importcn.bjsxt.uti...
package cn.bjsxt.solar;
import java.awt.Graphics;
import java.awt.Image;
import cn.bjsxt.util.GameUtil;
import cn.bjsxt.util.MyFrame;
/*
*
*
* 太阳系主窗口
*/
public class Solarframe extends MyFrame {
Image bg=GameUtil.getImage("/images/bg.jpg");
public void paint(Graphics g){
g.drawImage(bg, 0, 0, null);
}
public static void main(String[] args){
new Solarframe().lanuchFrame();
}
} 展开
import java.awt.Graphics;
import java.awt.Image;
import cn.bjsxt.util.GameUtil;
import cn.bjsxt.util.MyFrame;
/*
*
*
* 太阳系主窗口
*/
public class Solarframe extends MyFrame {
Image bg=GameUtil.getImage("/images/bg.jpg");
public void paint(Graphics g){
g.drawImage(bg, 0, 0, null);
}
public static void main(String[] args){
new Solarframe().lanuchFrame();
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询