How to handle itemStateChanged properly
itemStateChanged
is one of the common event in Swing framework. However, you might find that it usually fires out twice. The fact behind this behavior is there are 2 sub-events, says selected and unselected. Developer must deal with this property using getStateChange()
method.
if (e.getStateChange()==.SELCTED) { //do your actions }
- sugree's blog
- 645 reads
Recent comments
2 years 11 weeks ago
2 years 15 weeks ago
2 years 16 weeks ago
2 years 16 weeks ago
2 years 17 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 20 weeks ago