java - How can I customize the render of JRadioButton? -


i've created jradiobutton subclass in override paintcomponent method so:

@override protected void paintcomponent(graphics g) {     g.drawimage(         isselected() ?             getcheckedimg() :            getbasicimg()     , 0, 0, this); } 

but seems once button drawn, that's image uses forever. isselected test doesn't seem have effect. graphics cached or java? how provide custom jradiobutton selected , unselected image? have write custom ui?

read api. there methods like:

seticon() setselectedicon() 

among others can use instead of doing custom painting.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -