I am trying to display an image on a JPanel. I\'m using an ImageIcon for rendering the image, and the image is in the same directory as the class f
JPanel
ImageIcon
You should use
ImageIcon image = new ImageIcon(this.getClass() .getResource("org/myproject/mypackage/peanut.jpg"));