Bi-Directional Text

Java > Core SWING advanced programming > 2. USING JTEXTPANE > Summary

 

Summary

JTextPane is a very flexible component that you can use to display text with multiple fonts and colors when the simple JTextArea is not sufficient. In practice, as we have seen, JTextPane requires quite a lot of programming if you want to make the best possible use of it. In the course of explaining how this component works, we've shown you how the Swing Document model holds the color, font, and other information in the form of AttributeSets and Styles and the way in which attributes applied at the paragraph level relate to those that cover character ranges. In reality, you'll probably find it easier in many cases to use JEditorPane, which is fully described in Chapter 4, when you want to render formatted text. In the next chapter, we take a look at another aspect of the Swing text architecture the Views that determine how a component's content are rendered.

 

 



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