Re: Can I use different font-styles within the same TextArea?




Christian wrote:
...
I just wondered if I can have different colors for the text within the
same TextArea.

No. Why are you using AWT components?

..So I'd like to ask the ones that know if
that is possible in general.

Sure. In a JEditorPane or JTextPane.
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JEditorPane.html

Andrew T.

.



Relevant Pages

  • Re: How to display text messages in a scrolling text area?
    ... high-level and thus often more simple to use than JTextArea. ... JEditorPane or JTextPane. ...
    (comp.lang.java.gui)
  • Re: Mixing font colors in a JTextArea
    ... >> Use HTML in a JEditorPane. ... >> look to a JTextPane and manipulate the document attributes. ... > I find this slightly misleading. ... > HTML or the simple default styled text with both. ...
    (comp.lang.java.gui)
  • Re: Mixing font colors in a JTextArea
    ... > but how can I have different font colors in the same area? ... Use HTML in a JEditorPane. ... look to a JTextPane and manipulate the document attributes. ...
    (comp.lang.java.gui)
  • Re: Mixing font colors in a JTextArea
    ... >> JTextArea.setForegroundsets the font color for the entire component, ... > Use HTML in a JEditorPane. ... > look to a JTextPane and manipulate the document attributes. ... HTML or the simple default styled text with both. ...
    (comp.lang.java.gui)
  • Re: Rendering HTML in a JTextPane
    ... > JTextPane textPane = new JTextPane; ... JTextPane is a subclass of JEditorPane, ... http://KickJava.com - Java API By Example, From Geeks To Geeks. ... source codes. ...
    (comp.lang.java.gui)