Urgent - JTextPane - How to read and write the data from JTextPane including the Style of each data Element
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   tm_sk
Posted On:   Monday, April 23, 2001 11:09 PM

Hi,

* How can I retrieve the contents of a JTextPane (data including its Styles)?

* How can I enter this retrieved data into Another JTextPane?

* Can I convert the JTextPane contents(including Styles) into A String array or a Vector?

Please reply to me as fast as possible:
e_mail@vsnl.com

Re: Urgent - JTextPane - How to read and write the data from JTextPane including the Style of each data Element

Posted By:   Anonymous  
Posted On:   Monday, June 11, 2001 12:31 AM

hello,
JTextPane's contents are stored in its document.(i.e its model).You can retrieve its contents by simplify getting its document..ie

JTextPane text=new JTextPane();
StyledDocument=doc=text.getStyledDocument();

now, 'text' contents are stored in this 'doc'.If u like to set this 'doc' to another JTextPane,u can do the following...
JTextPane text2=new JTextPane();
text.setStyledDocument(doc);

thank yoy
About | Sitemap | Contact