The model is defined by the Document interface. The model interfaces are meant to capture the capabilities of expression given by SGML, a system used to express a wide variety of content.
For these components, the committed text is converted to keyTyped key events and processed in the key event pipeline starting at stage 3 instead of in the input method event pipeline. Typically a look-and-feel implementation will install a different keymap that resolves to the default keymap for those bindings not found in the different keymap.
Thread Safety The swing text components provide some support of thread safe operations. The methods that are safe to call asynchronously are marked with comments.
Location Information The capability of determining the location of text in the view is provided. Because of the high level of configurability of the text components, it is possible to circumvent the protection provided. Newlines For a discussion on how newlines are handled, see DefaultEditorKit.
If more advanced printing is needed, use the getPrintable java. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. Point for determining this information. The text document model may be shared by other views which act as observers of the model e.
A text component pulls together the objects used to represent the model, view, and controller.
To maintain compatibility with applications that listen to key events but are not aware of input method events, the input method handling in stage 4 provides a compatibility mode for components that do not process input method events. Each modification to the document causes notification of the details of the change to be sent to all observers in the form of a DocumentEvent which allows the views to stay up to date with the model.
The protection primarily comes from the model, so the documentation of AbstractDocument describes the assumptions of the protection provided.
Serialized objects of this class will not be compatible with future Swing releases. This is intended to provide a flexible text storage mechanism that tracks change during edits and can be extended to more sophisticated models. The support is provided by the Document model, which allows one to attach UndoableEditListener implementations.
This event is sent to observers that have implemented the DocumentListener interface and registered interest with the model being observed. There are two methods, modelToView int and viewToModel java. Printing support Several print methods are provided for basic document printing.
The minimal bindings include:JTextComponent is the base class for swing text components. It tries to be compatible with the mi-centre.commponent class where it can reasonably do so.
Also provided are other services for additional flexibility (beyond the pluggable UI and bean support).Download