Fit an Image on a JPanel
Hi all ,
I have a JDialog and a JPanel on it.
Now i want to diaplay an image on this JPanel.
It should be fit on jpanel i.e. scaled image
I have path of image file. I have wrote the following code
Image IMG = new ImageIcon("path to image");
Graphics g = jPanel1.getGraphics();
g.drawImage(IMG,0,0,jPanel1);
How do i do ?
thanks

