jpg not showing in canvas
I have a class that adds the following class to a container. Then shows the JFrame that contains the container. ie container.add(new MovieImage()); When the JFrame is made visible the image does not show. The image only appears when the JFrame is either resized or iconified then deiconified. Any suggestions as to how i could go about getting the image to appear the first time the JFrame is drawn? Thanks.
Code:
class DrinkImage extends Canvas{
public DrinkImage(){
setSize(25,50);
}
public void paint(Graphics g){
Toolkit tk = Toolkit.getDefaultToolkit();
Image image = tk.getImage("C:\\Beer.jpg");
g.drawImage(image,10,10,null);
}
}