A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
Fixing Max. char in JTextField
Joined: Jun 11, 2002
Sep 14, 2002 08:28:00
Hi to all,
I am working on
& want that my
should not take more than 1(or any fixed no.) chatacter. How to make this restriction.
I tried setColumns(1) method but it did nothing.
Joined: May 17, 2001
Sep 14, 2002 17:30:00
You need to create a document. Take a look at the sun tutorial on how to use them. If you don't have any luck post back.
Joined: Jul 03, 2002
Sep 16, 2002 00:10:00
You can extend the
and implement the Key Listener interface. In the keyTeyped() method, u can check the length and consume the keystrokes if the length >= 1.
Joy is a radiation
I agree. Here's the link:
subject: Fixing Max. char in JTextField
1 to N parameters in a method
Referencing JComponents programatically
JOptionPane.showInputDialog to accept multiple inputs
Using JTextfields in a JTabbedPane
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015