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.
KeesA
0
Newbie Poster
Recommended Answers
Jump to PostJust set the JLabel's imageicon to null
Jump to PostThat just nulls your local variable. You need to tell the JLabel to use a null icon, eg:
myJLabel.setIcon(null);
All 5 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
KeesA
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
KeesA
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.