Is it possible to have JTextField
scrollable without use of JScrollBar
.
For example, I would define field as max size 120
, but only 40
to be visible, the
rest is scrollable (left/right).
Similar, that HTML INPUT TEXT
works.
If you want to limit the user to entering 120 characters into the text field then you would use a DocumentFilter
. Read the section from the Swing tutorial on Implementing a DocumentFilter for a working example.