posted 12 years ago
Here is the code but it won't work and I wonder why? I will appreciate if somebody can help me out here! Thanks!!
public class LoadImages extends JPanel {
BufferedImage img = null;
public LoadImages(){
try{
img = ImageIO.read(new File( "craft.png"));
}catch (IOException e){}
}
@Override
protected void paintComponent(Graphics g){
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(img,0,0,this);
}
}//end LoadImages