Click here to Skip to main content
15,881,715 members
Home / Discussions / Java
   

Java

 
QuestionHow to create/set an element of a document Pin
prithaa6-Nov-12 3:43
prithaa6-Nov-12 3:43 
Hello,

I have a code like this
public class Doc extends DefaultStyledDocument{
}


Doc doc= new Doc();
doc.insertString(0, "This is a working document", null);
AbstractDocument.AbstractElement rootElement = doc.createDefaultRoot(); 



Once I create a root element how do I assign or set its value from the doc string.Currently the element is blank.

thnaks
Pritha
AnswerRe: How to create/set an element of a document Pin
padmanabanproject7-Nov-12 19:58
padmanabanproject7-Nov-12 19:58 
GeneralRe: How to create/set an element of a document Pin
prithaa4-Dec-12 3:55
prithaa4-Dec-12 3:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.