KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > swing > JTextPane

javax.swing
Class JTextPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JEditorPane
                      extended by javax.swing.JTextPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
See Also:
Top Examples, Source Code, XMLEncoder, StyledEditorKit

public Style addStyle(String nm,
                      Style parent)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1553]Rendering HTML in a JTextPane
By Anonymous on 2005/10/05 05:22:21  Rate
//Rendering HTML in a JTextPane 
  
  
 JTextPane textPane = new JTextPane (  ) ; 
 textPane.setContentType ( "text/html" ) ; 
 textPane.setText ( " < h1 > News < /h1 >  < p > News text < /p > " ) ;


[1554]_
By Anonymous on 2005/10/05 05:23:58  Rate
//More complete version 
  
  
 import javax.swing.*; 
  
  
 public class TestContentType  {  
  
  
    public static void main ( String [  ]  args )   {  
      JTextPane textpane = new JTextPane (  ) ; 
      textpane.setContentType ( "text/html" ) ; 
      textpane.setText ( " < h1 > News < /h1 >  < p >  Java Version: " + 
        System.getProperty ( "java.version" )  + " < /p > " ) ; 
      JOptionPane.showMessageDialog ( null, textpane ) ; 
     }  
  }  


protected EditorKit createDefaultEditorKit()
See Also:
JEditorPane
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public AttributeSet getCharacterAttributes()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public MutableAttributeSet getInputAttributes()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Style getLogicalStyle()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public AttributeSet getParagraphAttributes()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Style getStyle(String nm)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public StyledDocument getStyledDocument()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected final StyledEditorKit getStyledEditorKit()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getUIClassID()
See Also:
UIDefaults.getUI(javax.swing.JComponent), JEditorPane
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void insertComponent(Component c)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void insertIcon(Icon g)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public JTextPane()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public JTextPane(StyledDocument doc)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected String paramString()
See Also:
JEditorPane
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void removeStyle(String nm)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void replaceSelection(String content)
See Also:
JEditorPane
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setCharacterAttributes(AttributeSet attr,
                                   boolean replace)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setDocument(Document doc)
See Also:
JTextComponent.getDocument(), IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public final void setEditorKit(EditorKit kit)
See Also:
JEditorPane.getEditorKit(), IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setLogicalStyle(Style s)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setParagraphAttributes(AttributeSet attr,
                                   boolean replace)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setStyledDocument(StyledDocument doc)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags