Forums Register Login

Setting the width of a JTextPane

+Pie Number of slices to send: Send
Hello
I want to use a JTextPane in which the user should write whatever they want

I would like to have a limited width but an unlimited height on the JTextPane but I can't find a way to do that, so now I am asking:
is there a way to set the width of a JTextPane, inside a layout?

I am using a BorderLayout in the JFrame in which the JTextPane is located.

+Pie Number of slices to send: Send
Add the JTextPane to a JScrollPane. The text will wrap automatically when the width of the text pane is reached.

If you need more help then post your SSCCE that demonstrates the problem.
+Pie Number of slices to send: Send
 

Rob Camick wrote:Add the JTextPane to a JScrollPane. The text will wrap automatically when the width of the text pane is reached.

If you need more help then post your SSCCE that demonstrates the problem.



Just what I needed!
Thank you very much
mooooooo ..... tiny ad ....
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2720 times.
Similar Threads
viewports and scrollbars
Displaying all of the text in a JTextPane How???
determine with
JTable with TextRenderes as TextPane
JTextPane viewable area
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:42:32.