Skip to main content
  • 602 Accesses

Abstract

now that you’ve seen the capabilities of the relatively simple Swing components JLabel and JButton, it’s time to take a look at more-active components, specifically those that can be toggled. These so-called toggleable components—JToggleButton, JCheckBox, and JRadioButton — provide the means for your users to select from among a set of options. These options are either on or off, or enabled or disabled. When presented in a ButtonGroup, only one of the options in the group can be selected at a time. To deal with this selection state, the components share a common data model with ToggleButtonModel. Let’s take a look at the data model, the components’ grouping mechanism with ButtonGroup, and the individual components.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 1999 John Zukowski

About this chapter

Cite this chapter

Zukowski, J. (1999). Toggle Buttons. In: John Zukowski’s Definitive Guide to Swing for Java 2. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-5251-1_6

Download citation

  • DOI: https://doi.org/10.1007/978-1-4302-5251-1_6

  • Publisher Name: Apress, Berkeley, CA

  • Print ISBN: 978-1-893115-02-6

  • Online ISBN: 978-1-4302-5251-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics