class ImagePanel extends JPanel
{
private Image image;
public void paintComponent(Graphics g)
{
//Now draw the image scaled.
Rectangle r = this.getBounds();
int scaleWidth = r.width;
int scaleHeight = r.height;
String imagePath= "/com/ario/gui/resourceLibrary/images/wizardBG.jpg";
ImageIcon icon = new ImageIcon(getClass().getResource(imagePath));
image = icon.getImage();
g.drawImage(image, 0, 0, scaleWidth, scaleHeight, this);
}
}