Documents with Attributes

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.

 

 



Core Swing
Core Swing: Advanced Programming
ISBN: 0130832928
EAN: 2147483647
Year: 1999
Pages: 55
Authors: Kim Topley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net