java - jpanel implementing button behavior -


i want create radio button has more components default jradiobutton. i'm wondering best method is, should subclass jradiobutton adding components or better subclass jpanel , add behavior of radio button shown below.

---------jpanel--------------- - titel (label)              - - radiobutton (jradiobutton) - - description (label)        - ------------------------------ 

the whole panel should focusable , should provide feedback when clicked or has focus. help.

none of above.

  • don't extend components unless genuinely need extend functionality, not merely decoration.

  • don't confuse containment hierarchy class hierarchy.

  • don't defeat existing focus subsystem unless plan provide own.

  • if want alter appearance of panel when radio button's focus changes, in focus listener attached button. background color of opaque panel bound property, setbackground() should sufficient.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -