Java Reference
In-Depth Information
Table 17.1 Major SWT widgets and their Swing equivalents
SWT widget
Analogous Swing
component
Description
Display widget that sends notification when
pressed and/or released.
Button
JButton
java.awt.Canvas ,
but see also
java.awt.Graphics2D
Composite widget that provides a surface for
drawing arbitrary graphics. May be used to
create custom widgets.
Canvas
A cursor used as the insertion point for text.
Caret
javax.swing.text.Caret
Widget that permits the user to choose a
string from a list of strings, or to enter a new
value into a text field.
Combo
JComboBox
Widget that is capable of containing other
widgets.
Composite
JPanel
Composite widget that groups other widgets
and surrounds them with an etched border
and/or label.
Group
JPanel
Nonselectable widget that displays an image
or a string.
Label
JLabel
Selectable widget to choose a string or strings
from a list of strings.
List
JList
User interface widget that contains menu
items.
Menu
JMenu
JMenuItemA ,
JCheckboxMenuitem ,
JRadioButtonMenuitem
Selectable widget that represents an item in a
menu.
MenuItem
Nonelectable widget that displays progress to
the user.
ProgressBar
JProgressBar
Widget that represents a range of numeric
values.
Scale
JSpinner
Widget that represents a range of positive
numeric values. Used in a Composite that
has V_SCROLL and/or H_SCROLL styles. The
mapping to Swing is not very tight here, since
JScrollPane is like a combination of
Composite and ScrollBar .
ScrollBar
JScrollPane
Search WWH ::




Custom Search