Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set the horizontalscrollbar to never  RSS feed

 
Krishna Priya
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a textbox in the scrollpane. I am able to set the verticalscroll on when needed with the following code but, when I type in text the text is taken vertically, it is not wrapping to the next line. How do I do this. Are there any methods to wrap the text to the next line after a specified width? Any help is greately appreciated.


scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

Thank You,
Sujatha.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happened when you read the api docs for JTextArea?

did you miss setLineWrap(...)?

(you should also delete your duplicate post)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!