•In general every Swing GUI consists of “components” and “containers”.
•All containers are components.
•A component is a thing/object that has a visual appearance and on which user can perform events.
•A container is a object/thing which can hold other components.
•Since all containers are components, a container can hold other containers.
•Every component must be added to a container in order to display it.
•So, every Swing GUI will contain atleast one container.
•This allows for container hierarchy, in which at the top we will have “top-level containers”.
•All the Swing components are derived from the “JComponent” class except the four top level containers: JFrame, JApplet, JWindow and JDialog.
•The above four top level containers are the only heavy weight components in the Swing package.
•“JComponent“ inherits both “Container” and “Component” in AWT package.
•So, all the Swing components are built on top of the AWT components.
•The four top level containers: JFrame, JApplet, JWindow and JDialog do not inherit “JComponent“ class.
•The are two types of containers in Swing. They are:
•Top-level containers (JFrame, JApplet, JWindow and JDialog)
•Light weight containers (JPanel)
•Following are some of the examples of Swing components:
1.JLabel
2.JButton
3.JToggleButton
4.JCheckBox
5.JRadioButton
6.JComboBox
7.JList
8.JTextField
9.JScrollPane
10.JTabbedPane
11.JTree
12.JTable
•All containers are components.
•A component is a thing/object that has a visual appearance and on which user can perform events.
•A container is a object/thing which can hold other components.
•Since all containers are components, a container can hold other containers.
•Every component must be added to a container in order to display it.
•So, every Swing GUI will contain atleast one container.
•This allows for container hierarchy, in which at the top we will have “top-level containers”.
•All the Swing components are derived from the “JComponent” class except the four top level containers: JFrame, JApplet, JWindow and JDialog.
•The above four top level containers are the only heavy weight components in the Swing package.
•“JComponent“ inherits both “Container” and “Component” in AWT package.
•So, all the Swing components are built on top of the AWT components.
•The four top level containers: JFrame, JApplet, JWindow and JDialog do not inherit “JComponent“ class.
•The are two types of containers in Swing. They are:
•Top-level containers (JFrame, JApplet, JWindow and JDialog)
•Light weight containers (JPanel)
•Following are some of the examples of Swing components:
1.JLabel
2.JButton
3.JToggleButton
4.JCheckBox
5.JRadioButton
6.JComboBox
7.JList
8.JTextField
9.JScrollPane
10.JTabbedPane
11.JTree
12.JTable