Problems loading image into a JLabel located in a JScrollPane
posted 11 years ago
I successfully loaded an image into a JLabel. I wanted to be able to scoll the image so I put the JLabel into a JScrollPane and now the image will not load into the JLabel. The control is done by a button off to the side and the actionPerformed method has the logic below: Image image = null; ImageIcon icon = new ImageIcon (Toolkit.getDefaultToolkit().createImage("C:\\FILES\\finger1.jpg")); jLabel2.setIcon(icon); this.repaint(); Do you know what I have to do to get the image to pop up into the JScrollPane with the JLabel in the JScrollPane? Is this possible? Send help, I am a JBuilder newbie. Thanks, Melanie.