Home  >  Q&A  >  body text

How can Textarea in JAVA achieve line wrapping beyond a certain width?

Assuming that the Textarea is set to a fixed width of 100,
How to implement the automatic line change when the text width exceeds 100?
The problems encountered on Baidu are all solved using JTextarea, which is not what I want.

PHP中文网PHP中文网2712 days ago677

reply all(2)I'll reply

  • 某草草

    某草草2017-05-17 10:08:49

    I don’t understand your question. Why do the textareas I use automatically wrap lines? If the scroll bar appears because it is too long, just use overflow-x:hidden and overflow-y:hidden to hide the scroll bar
    This is my textarea, set the length and width, and it will automatically wrap. Or do you not want to use the actual length and width of the textarea to limit line breaks? If this is the requirement, adding span or p inside will solve the problem

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-17 10:08:49

    It should be JavaScript

    reply
    0
  • Cancelreply