Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in getting a copy of JTextPane  RSS feed

Chella Anu
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);
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!