Java > Core SWING advanced programming > 1. THE SWING TEXT COMPONENTS: CREATING CUSTOMIZED INPUT FIELDS > Summary
Summary
This chapter covers just about all you need to know about the basic Swing input fields, JTextField and JTextArea. Starting with a brief overview of the Swing text controls, we moved on to look at their basic architecture, which we'll make much use of in the next four chapters of this book. By exploiting the separation between the graphical user interface (GUI) component and the Document model that lies behind it, we were able to create several powerful custom components that offer facilities that you'll be able to use in real-world applications, including text fields that accept only a limited number of characters and the ability to help the user by providing a look-ahead feature that can minimize typing when there is a fixed set of possible acceptable values, as is often the case in form-based applications. Finally, we saw how to create a custom caret and use a keymap to change characteristics of a text component in response to key presses that are not passed to the Document model.