| Author |
Setting the width of a JTextPane
|
Frederick Winsnes
Greenhorn
Joined: Feb 22, 2011
Posts: 17
|
|
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.
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1788
|
|
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.
|
 |
Frederick Winsnes
Greenhorn
Joined: Feb 22, 2011
Posts: 17
|
|
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
|
 |
 |
|
|
subject: Setting the width of a JTextPane
|
|
|