Forums Register Login

Problem in getting a copy of JTextPane

+Pie Number of slices to send: Send
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);
**************************
Hold that thought. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 777 times.
Similar Threads
Displaying lines with multiple colors
How can we make highlight some text in text editor in java????
Possible to Change Selected Text Font ?
Find index by xy ??
color Java text
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:36:27.