This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make jTextField 's input unscrollable?

 
walter wang
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All
i create a JTextField, i want to set it inputsize = 5(charaters)
i am doing like this
JTextField jTextField = new JTextField(5);
jTextField.setScrollOffset(0);
but it doesnot work out
it is still scrollable, i main i could input more than
5 charaters
How to fix JTextField's input size?
Thx in advance
Walter wang
 
Paul Stevens
Ranch Hand
Posts: 2823
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to create a class that extends PlainDocument and override the insertString() like this:


[This message has been edited by Paul Stevens (edited December 17, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic