ImageIcon do not update for a new image with the same URL

前端 未结 1 1738
后悔当初
后悔当初 2021-01-21 17:17

I would like to use JLabel(Icon) to show a Image which is from my website(http://xxx.xxx.xxx.xxx/java_pic/test.jpg). And I have a refresh button to new a new JLabel and ImageIco

相关标签:
1条回答
  • 2021-01-21 17:37

    The image is cached. Flush to clear the cache:

    imageIcon.getImage().flush();
    
    0 讨论(0)
提交回复
热议问题