O'Reilly logo

Core SWING advanced programming by KIM TOPLEY

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. USING JTEXTPANE

Topics in this Chapter

  • Attributes and Styles

  • Style Contexts

  • Paragraph and Character Attributes

  • Displaying Icons and Attributes in JTextPane

In the last chapter, you saw how the text components store the text that they draw and how to subclass the PlainDocument class used by JTextField to implement various forms of input validation. PlainDocument is a very simple text model that is sufficient for a component that uses a single font and two colors, but the Document interface itself also allows you to associate attributes with arbitrary ranges of content within the model, a facility that can be exploited by using the JTextPane and JEditorPane controls.

In this chapter, you'll see exactly what the attributes that you can store ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required