Definition of Java Components :
- A graphical user interface is composed of individual building blocks such as push buttons, scrollbars, and pull-down menus.
- Some programmers know these individual building blocks as controls, while others call them widgets.
- In Java, they are typically called components because they all inherit from the base class java.awt.Component.
- When you are describing a GUI toolkit, one of the most important characteristics is the list of components it supports.
- lists the heavyweight components provided by AWT, where heavyweight refers to components that are layered on top of native GUI components.
- The components listed are all classes in the java.awt package.
- One of the curious features of the AWT is that pull-down and pop-up menus, and the items contained within those menus, are not technically components.
- Instead of inheriting from Component, they inherit from java.awt. MenuComponent.
- Nevertheless, the various menu component classes are used in very much the same way that true components are.
- A Component object represents a graphical interactive area displayable on the screen that can be used by the user.
- Any subclass of a Component class is known as a component. For example, button is a component.
- Only components can be added to a container, like frame.
Component Name
|
Description
|
Button
|
A graphical push button.
|
Canvas
|
A heavyweight component that displays a blank canvas, allowing a
program to display custom graphics.
|
Checkbox
|
A toggle button that can be selected or unselected. Use
the Checkbox group to enforce
mutually exclusive or radio button behavior among a group of Checkbox components.
|
CheckboxMenuItem
|
A toggle button that can appear within a Menu.
|
Choice
|
An option menu or drop-down list. Displays a menu of options
when clicked on and allows the user to select among this fixed set of
options.
|
Component
|
The base class for all AWT and Swing components. Defines many
basic methods inherited by all components.
|
FileDialog
|
Allows the user to browse the filesystem and select or enter a
filename.
|
Label
|
Displays a single line of read-only text. Does not respond to
user input in any way.
|
List
|
Displays a list of choices (optionally scrollable) to the user
and allows the user to select one or more of them.
|
Menu
|
A single pane of a pull-down menu
|
MenuBar
|
A horizontal bar that contains pull-down menus.
|
MenuComponent
|
The base class from which all menu-related classes inherit.
|
MenuItem
|
A single item within a pull-down or pop-up menu pane.
|
PopUpMenu
|
A menu pane for a pop-up menu.
|
Scrollbar
|
A graphical scrollbar.
|
TextArea
|
Displays multiple lines of plain text and allows the user to
edit the text.
|
TextComponent
|
The base class for both TextArea and TextField.
|
TextField
|
Displays a single line of plain text and allows the user to edit
the text.
|