public void paintComponent(Graphics g)没有调用public void setImageFile(File f)方法!
public void setImageFile(Graphics g)里面加一个画图的方法,把paintComponent的g.drawImage(image,0,0,w,h,this);放到方法setImageFile里面,然后
int w = getBounds().width;
int h = getBounds().height;
public void paintComponent(Graphics g)
{
super.paintComponent(g);
setImageFile(g);
}
main方法呢,没有主进程你怎么执行程序
啊
我也在搞着