I realise there have been several posting on this subject already.
However, despite these, I still can't quite work out how to do this.
I need to take the image from a file (.gif .jpg etc), ensure that the
entire image fits on a JPanel of some size, then put this JPanel onto
another Jpanel.
From what I could gather, it looked like I had to extend JPanel and
override paint(). The problem comes when I try to use drawImage().
Here's the code.
//relevent imports
public class Picture extends JPanel
{
private String fileName;
/** Creates a new instance of Picture */
public Picture(String file)
{
fileName=file;
}
public void paint(Graphics g)
{
super.paintComponent(g);
}
}
John Davison - 08 Mar 2004 17:54 GMT
> I realise there have been several posting on this subject already.
> However, despite these, I still can't quite work out how to do this.
[quoted text clipped - 26 lines]
> }
> }
Where is your call to drawImage()?
John