Abstract
This chapter presents other input components available in the Swing class hierarchy. Specifically, it deals with some specialized text input fields, such as JPassword, three types of ComboBoxes (static, editable, and dynamic), and formatted text fields. Additionally, I combine some of these while discussing the JSpinner class at the end of the chapter.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
Unfortunately, there are lots of ways for script writers to overlook good security practices, so be careful.
- 3.
It is interesting to note that even though the password text is visible, you still can’t copy its value to the system’s clipboard.
- 4.
- 5.
Table 7-2 only lists the function signatures that have a typeCode argument for simplicity’s sake.
- 6.
The expression (i.e., cb.getItemCount() > 1) will be true (i.e., 1) when more than one item is present on the list; this keeps the button enabled. When the list only has one item, the expression is false (i.e., 0) and the button is disabled.
- 7.
- 8.
- 9.
Note: You’ll revisit the JFormattedTextField class in Chapter 14.
- 10.
Note: The eval() function, as shown in line 15, is normally discouraged. However, using it in this example allowed the addFTF() method call to be greatly simplified and much shorter.
- 11.
- 12.
Line 5 is included to show how an alias for the DateFormatSymbols was defined. This allowed line 17 to be short enough to be fit easily in the available space.
- 13.
- 14.
There are many more methods provided by the DateFormatSymbols class that aren’t covered in this book. Feel free to experiment with and use these other methods.
- 15.
This is not a bug, as is explained in the bug report found here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4146173 . It’s a feature. Personally, I kind of like the explanation that exists in various places on the web that these eight-day weeks and 13-month years were created for managers and product planners to explain and justify the development schedules. But that’s just a guess.
- 16.
- 17.
- 18.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Robert A. Gibson
About this chapter
Cite this chapter
Gibson, R.A. (2015). Other Input Components. In: Swing for Jython. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0817-5_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0817-5_7
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)