Abstract
So far, you have learned how to use simple buttons and a variety of text input fields. In this chapter, you’ll take a look at using some other input components, ones that can be selected. All of the components in this chapter have two possible states, they are either selected or not. I’ll start by describing toggle buttons, proceed to check boxes, and then to radio buttons. I will also discuss how to group these fields in order to make interesting user presentations.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
Initially, I had the code to create and add each JCheckBox to the frame on a single line. Width limitations for these listings, however, meant that it would be best, at least for this example, to create and use the addCB() method in lines 9-15 instead.
- 6.
- 7.
- 8.
Unless, of course, you have something like an event handler deselect everything in the group.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Robert A. Gibson
About this chapter
Cite this chapter
Gibson, R.A. (2015). Selectable Input Components. In: Swing for Jython. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0817-5_8
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0817-5_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0818-2
Online ISBN: 978-1-4842-0817-5
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)