0

Is it possible to remove an Icon or ImageIcon once it is set to a JButton or JLabel?
When a specific action in my program has taken place, the picture in no more appropriate and I want to remove it from a JLabel.

2
Contributors
5
Replies
6
Views
4 Years
Discussion Span
Last Post by JamesCherrill
0

Does not seem to work.
To try it, I wrote:

alarmLab.setIcon(labIcon);
labIcon = null;

The icon stays visible.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.