Results 1 to 5 of 5

Thread: Use of JTextPane class

  1. #1
    Join Date
    Dec 2009
    Posts
    59

    Use of JTextPane class

    Hello Friend,

    I am beginner to the advanced java programming. I have one confusion about the 'JTextPane class' of java. I don't have any idea about the use of JTextPane class. I want to be ware about the 'JTextPane class'. I have referred lots of websites for JTextPane class of java, but didn't get proper details about this class. Do you have knowledge about the 'JTextPane class' of java? if yes then please let me know that.

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    Re: Use of JTextPane class

    A JTextPane class is a text component that can be marked up with attributes that are represented graphically. This component models paragraphs that are composed of runs of character level attributes. Each paragraph may have a logical style attached to it which contains the default attributes to use if not overridden by attributes set on the paragraph or character run. Components and images may be embedded in the flow of text.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Use of JTextPane class

    Hello friend,

    I suggest you to refer following methods of JTextPane class:
    • setStyledDocument(StyledDocument dc)
    • setParagraphAttributes(AttributeSet atbr, boolean bln)
    • setLogicalStyle(Style st)
    • setEditorKit(EditorKit kt)
    • setCharacterAttributes(AttributeSet atbr, boolean bln)
    • removeStyle(String stg)

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Use of JTextPane class

    Example of JTextPane class of java:
    Code:
    class JTextPanedEMO extends JEditorPane {
    	
    	private static final String uiClassID = "TextPaneUI";
    	
    	public JTextPane() {
    		
    	} 
    	public JTextPane(StyledDocument docnm) {
    		
    	} /
    	private void writeObject(ObjectOutputStream stream) throws IOException {
    	
    	public String getUIClassID() {
    		return uiClassID;
    	} 
    	public void setDocument(Document docnm) {
    		
    	} 
    	public StyledDocument getStyledDocument() {
    		return null; 
    	} 
    	public void setStyledDocument(StyledDocument docnm) {
    		
    	}
    	public void replaceSelection(String content) {
    		
    	} 
    	public void insertComponent(Component component) {
    		
    	} 
    	public void insertIcon(Icon icon) {
    		
    	} 
    	
    	public Style addStyle(String nm, Style parent) {
    		return null; // TODO
    	} 
    	public void removeStyle(String nm) {
    		
    	} 
    	
    	
    	protected final StyledEditorKit getStyledEditorKit() {
    		return null; // TODO
    	}
    	
    	protected EditorKit createDefaultEditorKit() {
    		return null; // TODO
    	} 
    	public final void setEditorKit(EditorKit editor) {
    		
    	} 
    	protected String paramString() {
    
    
    		return null; // TODO
    	} 
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,389

    Re: Use of JTextPane class

    A JTextPane class of java is basically extended from the "javax.swing.JEditorPane" package. This java package is again the subclass of 'javax.swing.text.JTextComponent'. A MenuContainer and Serializable are nothing but the two implementable interfaces of the JTextPane class. JTextPane class extends 'JEditorPane'. A getStyledEditorKit() is very important method of the JTextPane class, this method is used for getting editor kit.

Similar Threads

  1. Replies: 8
    Last Post: 08-10-2011, 11:06 PM
  2. Import a text file in JTextPane
    By Ash maker in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 11:17 AM
  3. Disable resizing of JTextPane
    By TechGate in forum Software Development
    Replies: 5
    Last Post: 19-01-2010, 01:27 PM
  4. Ultra solid drives:Imation M-Class and S-Class
    By Regina in forum Portable Devices
    Replies: 1
    Last Post: 03-04-2009, 10:34 AM
  5. Good news for CBSE CLASS X & CLASS IX - visit learnnext
    By surya_expert in forum Education Career and Job Discussions
    Replies: 0
    Last Post: 13-12-2008, 12:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,981,517.91616 seconds with 17 queries