I want to use jTextFields that will only accept a fixed number of
characters (without scrolling to the left), and that will limit the
input to only numeric digits. Any thoughts?
GreenMountainBoy
Andrew Thompson - 26 Jan 2007 04:19 GMT
On Jan 26, 2:53 pm, "GreenMountainBoy" <william.fi...@gmail.com>
wrote:
> I want to use jTextFields that will only accept a fixed number of
> characters (without scrolling to the left), and that will limit the
> input to only numeric digits. Any thoughts?
Please cross-post, rather than multi-post (/repost*).
* Note that the text is reworked, and the post better
titled, on the later post to c.l.j.help.
(X-post to c.l.j.g./h., w/ f-u to c.l.j.h. only)
Andrew T.
Real Gagnon - 26 Jan 2007 22:29 GMT
> I want to use jTextFields that will only accept a fixed number of
> characters (without scrolling to the left), and that will limit the
> input to only numeric digits. Any thoughts?
Try
http://www.rgagnon.com/javadetails/java-0197.html
to filter numeric input
http://www.rgagnon.com/javadetails/java-0198.html
for the maximum length.
Bye.

Signature
Real Gagnon from Quebec, Canada
* Looking for Java or PB code examples ? Visit Real's How-to
* http://www.rgagnon.com/howto.html
Corona4456 - 27 Jan 2007 18:36 GMT
Try using this: http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
JFormattedTextField.html
> > I want to use jTextFields that will only accept a fixed number of
> > characters (without scrolling to the left), and that will limit the
[quoted text clipped - 8 lines]
> * Looking for Java or PB code examples ? Visit Real's How-to
> *http://www.rgagnon.com/howto.html
Andrew Thompson - 27 Jan 2007 19:02 GMT
> Try using this:http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
> JFormattedTextField.html
A couple of notes..
- Long URL's can be protected from line wrap
by enclosing them in '<' & '>'. E.G.
<http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
JFormattedTextField.html>
- This suggestion had already been made as a
reply to one of the OP's other multi-posts. I.E.
<http://groups.google.com/groups?selm=tBfuh.1464$wv6.251@newsfe04.lga>
- The post to which you replied had no content
on which you were commenting. It would have
been better to reply to the OP's first post.
Also, please refrain from top-posting. I find
it very confusing.
Andrew T.
Andrew Thompson - 27 Jan 2007 19:07 GMT
> > Try using this:http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
> > JFormattedTextField.htmlA couple of notes..
[quoted text clipped - 3 lines]
> <http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
> JFormattedTextField.html>
Well damn it.. usually they can, I'll try that again*..
<http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
JFormattedTextField.html>
(and a different way)
<url:http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
JFormattedTextField.html>
*grrr.. where did GG put the dang 'Preview' link?
I am not liking the 'new look' GG.
Andrew T.
GreenMountainBoy - 28 Jan 2007 23:40 GMT
Apparently the long URL line wrap doesn't work.
> > > Try using this:http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/
> > > JFormattedTextField.htmlA couple of notes..
[quoted text clipped - 13 lines]
>
> Andrew T.