- SWING Tutorial
- SWING - Home
- SWING - Overview
- SWING - Environment
- SWING - Controls
- SWING - Event Handling
- SWING - Event Classes
- SWING - Event Listeners
- SWING - Event Adapters
- SWING - Layouts
- SWING - Menu
- SWING - Containers
SWING - Containers
Containers are an integral part of SWING GUI components. A container provides a space where a component can be located. A Container in AWT is a component itself and it provides the capability to add a component to itself. Following are certain noticable points to be considered.
Sub classes of Container are called as Container. For example, JPanel, JFrame and JWindow.
Container can add only a Component to itself.
A default layout is present in each container which can be overridden using setLayout method.
Following is the list of commonly used containers while designed GUI using SWING.
|Container & Description
JPanel is the simplest container. It provides space in which any other component can be placed, including other panels.
A JFrame is a top-level window with a title and a border.
A JWindow object is a top-level window with no borders and no menubar.
Kickstart Your Career
Get certified by completing the courseGet Started