Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JScrollPane vs. ImageIcon  RSS feed

 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.



 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!