File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to make jTextField 's input unscrollable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make jTextField Watch "How to make jTextField New topic
Author

How to make jTextField 's input unscrollable?

walter wang
Ranch Hand

Joined: Jun 02, 2001
Posts: 150
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


public class Walter { public boolean is_Working_Now (boolean is_boss_Coming) { return is_boss_Coming; }
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
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
 
subject: How to make jTextField 's input unscrollable?
 
Similar Threads
JOptionPane.showInputDialog to accept multiple inputs
Reg. Validatin JTextFields
Get data from jtext field
How to set the formatter in Eclipse?
How to set the size of a JTextField ?