aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JScrollPane vs. ImageIcon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JScrollPane vs. ImageIcon" Watch "JScrollPane vs. ImageIcon" New topic
Author

JScrollPane vs. ImageIcon

Kee Kee moon
Ranch Hand

Joined: Dec 11, 2009
Posts: 147
Please ignore this post, I have resolve the problem.


I use ActionListener to runt he following codes, but I could not change ImageIcon, as soon as I scroll the scrollPane up and down, the original ImageIcon will display
on the frame instead of the new ImageIcon. I have try icon.getImage().flush() but it did not work, still cannot update the new ImageIcon.

label.setIcon(icon)
panel.add(label,BorderLayout.CENTER);
JScrollPane scrollPane = new JScrollPane(panel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

Please help.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JScrollPane vs. ImageIcon