
Development of Swing continues, and Java 1.3 will ship with a new version that
includes a number of minor changes and improvements to the Swing API. This
futur erelease will focus on improving the existing APIs and should not add many
new APIs.
Labels and HTML
In the initial releases of Swing 1.1 and Java 1.2, the JLabel, JButton, and related
classes that display textual labels can display only a single line of text using a sin-
gle font. In Swing 1.1.1 and Java 1.2.2, however, components like these can dis-
play multiline, multifont text using simple HTML formatting. To display formatted
text, simply specify a string of HTML text that begins with an
<HTML> tag. You can
use this feature to present text using multiple fonts, font styles, and colors. Just as
important, however, the introduction of HTML allows you to specify multiline
labels.
This new formatted text display feature is available in Java 1.2.2 for the
JLabel,
JButton, MenuItem, JMenu, JCheckBoxMenuItem, JRadioButtonMenuItem, JTabbed-
Pane, and JToolTip classes. It is not supported (at least in Java 1.2.2) by JCheckBox
or JRadioButton, however. For matted text display is particularly useful with JOp-
tionPane dialog boxes (described later in this chapter), as they display text using
inter nal
JLabel objects.
Actions
A GUI application often allows a user to invoke an operation in a number of dif-
fer ent ways. For example, the user may be able ...