I’m trying to figure out the below code. ImageIcone called “non-static method” getImage() according to Java API without any instance variable:
public void paintComponent(Graphics g) {
Image img = new ImageIcon("imgtest.jpg", "description...").getImage();
g.drawImage(img,3,4,this);
}