Hi. Please could anyone help me look at this code and tell me why the image is not getting drawn? I have already cross-checked the path, and it is alright, as it does not throw any exception. Thanks in advance.
class PotPanel extends JPanel{
public PotPanel(int width, int height){
Dimension size = new Dimension(width, height);
setPreferredSize(size);
setMinimumSize(size);
setMaximumSize(size);
setSize(size);
setLayout(null);
}
@Override
public void paintComponent(Graphics g){
super.paintComponent(g);
BufferedImage imoge = null;
try {
imoge = ImageIO.read(new File("C:\\projectPics\\seed1.png"));
} catch (IOException e) {
e.printStackTrace();
}
g.drawImage(imoge, getWidth(), getHeight(), null);
}
}