12.10.1 JCheckBox
The application of Figs. 12.17–12.18 uses two JCheckBox
es to select the desired font style of the text displayed in a JTextField
. When selected, one applies a bold style and the other an italic style. If both are selected, the style is bold and italic. When the application initially executes, neither JCheckBox
is checked (i.e., they’re both false
), so the font is plain. Class CheckBoxTest
(Fig. 12.18) contains the main
method that executes this application.
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.