dimanche 30 novembre 2014

Why 'JButton' is-a 'Container' in javax.swing?


As per the class hierarchy in java.awt.*, class Button & class Label is-a class Component, and Component is not a Container, which make sense to me.


As per the redesign of class hierarchy in javax.swing.*, class JButton is-a class JComponent in-turn class JComponent is-a class Container,


So, What does it mean to say that, class JButton or class JRadioButton is-a class Container? How could one think of using button or radiobutton be used as container in GUI programming?


Note: I am java beginner.





Aucun commentaire:

Enregistrer un commentaire