• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in getting a copy of JTextPane  RSS feed

 
Chella Anu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need help to get an identical copy of a JTextPane (with all attributes and text). When the font size of the second textpane is changed with the following code it must not affect the first TextPane.
**************************
SimpleAttributeSet attributes = new SimpleAttributeSet();
StyleConstants.setFontSize(attributes, 11);
int length = txtPane2.getDocument().getLength();
txtPane2.getStyledDocument().setParagraphAttributes(0, length, attributes, false);
**************************
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!