I'm trying to draw an image inside a jScrollPane, or in any other scrollable type of panel... can someone please give me a VERY simple method as I'm new to java.. I have read all about jScrollPane on Oracle and about drawImage but can't find a way to do it ... :/ can someone please explain whats wrong?
img = ImageIO.read(new File("C:\\apple.png"));
Graphics g = jScrollPane1.getGraphics();
g.drawImage(img, 0, 0, 100, 100, rootPane);
//I also tried to use paintComponents... but .. not successful.