I want to add a JTextArea
to an application. Normally that textarea contains large content and both horizontal and vertical ScrollBars
appear when running that application. I want to remove horizontal scrolling; I have found that it is possible with
HORIZONTAL_SCROLLBAR_NEVER
field but then it does not show the complete contents (it doesn't wrapped horizontally and move content to next row). how to overcome this. I want to stop horizontal scrolling and put contents in next row without scrolling it on a row.
Try this:
yourJTextArea.setLineWrap(true);
yourJTextArea.setWrapStyleWord(true);