Anybody know of a free custom swing component that represents an IP address.
Or does anybody know how to format a JTextField to only allow ip addresses.
So basically I want to keep it in the form 192.168.1.101.
Any suggestions
Thanks
|
|
0
|
|
|
|
Reply
|
Ken
|
1/27/2005 7:02:24 AM |
|
In article <4m0Kd.153964$KO5.74217@clgrps13>,
"Ken Adams" <hockeyGuy17@hotmail.com> wrote:
>:Anybody know of a free custom swing component that represents an IP address.
>:Or does anybody know how to format a JTextField to only allow ip addresses.
>:So basically I want to keep it in the form 192.168.1.101.
>:
>:Any suggestions
>:
>:Thanks
Personally, I would suggest using four fields instead of one, where each
individual field can contain values ranging from 000 to 255 and perhaps
typing the third digit could even auto-tab out to the next field.
It would be far easier to write a single JTextField subclass that
accepts only numeric input and only a max set of digits, etc. You can
easily display these in such a way that the dots appear between them on
other components. And with a little experimentation, you might even be
able to set up other restrictions if needed, like not allowing 000 in
certain octets.
= Steve =
--
Steve W. Jackson
Montgomery, Alabama
|
|
0
|
|
|
|
Reply
|
Steve
|
1/27/2005 4:37:45 PM
|
|
You can attach a specialized document to your textfield. Or use the
JFormattedTextField with a MaskFormatter.
Steve W. Jackson wrote:
> In article <4m0Kd.153964$KO5.74217@clgrps13>,
> "Ken Adams" <hockeyGuy17@hotmail.com> wrote:
>
>
>>:Anybody know of a free custom swing component that represents an IP address.
>>:Or does anybody know how to format a JTextField to only allow ip addresses.
>>:So basically I want to keep it in the form 192.168.1.101.
>>:
>>:Any suggestions
>>:
>>:Thanks
>
>
> Personally, I would suggest using four fields instead of one, where each
> individual field can contain values ranging from 000 to 255 and perhaps
> typing the third digit could even auto-tab out to the next field.
>
> It would be far easier to write a single JTextField subclass that
> accepts only numeric input and only a max set of digits, etc. You can
> easily display these in such a way that the dots appear between them on
> other components. And with a little experimentation, you might even be
> able to set up other restrictions if needed, like not allowing 000 in
> certain octets.
>
> = Steve =
|
|
0
|
|
|
|
Reply
|
Symon
|
1/27/2005 9:47:04 PM
|
|
In a previous article, Symon <symon@tatouage.fr> said:
>You can attach a specialized document to your textfield. Or use the
>JFormattedTextField with a MaskFormatter.
I know of no way to make JFormattedTextField with a MaskFormatter restrict
to a maximum value. It would be hard enough to do what I want (for
entering times, restrict the minutes and seconds parts to 00-59), but it
would be much, much harder to restrict a field to 0-255.
--
Paul Tomblin <ptomblin@xcski.com> http://xcski.com/blogs/pt/
I haven't had any mail from my mother since her ISP ended up in the RBL.
I deny that I nominated them...
-- Peter Corlett
|
|
0
|
|
|
|
Reply
|
ptomblin
|
1/27/2005 10:35:02 PM
|
|
Ken Adams wrote:
> Anybody know of a free custom swing component that represents an IP
address.
> Or does anybody know how to format a JTextField to only allow ip
addresses.
> So basically I want to keep it in the form 192.168.1.101.
>
> Any suggestions
>
> Thanks
I think this covers the subject pretty well:
http://java.sun.com/developer/JDCTechTips/2001/tt1120.html
The 4th way (MVC) is probably the best for this case.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
|
|
0
|
|
|
|
Reply
|
Nigel
|
1/28/2005 9:57:08 AM
|
|
|
4 Replies
1352 Views
(page loaded in 0.102 seconds)
Similiar Articles: Regex to match a numerical IP range - comp.lang.perl.misc ...... obvious and its pretty slow comparitively, not only ... thought it was just a case of knowing the simple ip address ... # '*' should speed up the match but will allow ranges of [0 ... access control and pool servers - comp.protocols.time.ntp ...:-) restrict 127.0.0.1 ### local section 2: allow ... in the script? > > Right now, ntpd will only ever see the first IP address ... This is a multi-part message in MIME format ... Operation not permitted when trying to contact time server - comp ...If you do not allow UDP on port 123, both > inbound ... This is a multi-part message in MIME format ... pre wrap=""><!----> They have different IP addresses. Only ... w32tm DC error - comp.protocols.time.ntpFinally, the windows time service in XP will only keep ... Command "netstat -na" shows [ip-address]:123 > If you ... If so did you configure your firewall to allow packets ... Can or should the NTP protocol eventually serve timezone data ...Is that FTP server robust enough to allow for e.g ... Here is the format: <http://en.wikipedia.org/wiki ... Network Time Protocol server and client ... only with unknown IP ... TCP MSS issue - comp.unix.programmerIf you only write() a few hundred bytes, then that's ... Some allow it, some do not. rick jones -- firebug n ... used by Lachman to implement a streams-based internet protocol ... Multiple Auto Expire Script - comp.lang.javascriptI have the script working if I have only one event in ... Why not use the standard Javascript date format for your ... IP address lookup with javascript? - comp.lang.javascript ... Newbie's first FPGA board ! - comp.arch.fpgaWhat format should I use ? I use Eagle, so I can give ... streaming up to 100 Mbps and the Linux TCP/IP ... If your design rules allow it, something like a CTS ... dd command for remote disk copy? - comp.os.linux.networking ...The second fix addresses the problem that with a single dd ... Unix and similar OSs allow you to read/write block ... comp.unix.solaris Windows 95 Boot disk in .flp format ... FAT file system for DSP/BIOS? - comp.dsp... to find, e.g., and IOM mini-driver that would allow ... have to publish anything to link against Ecos, you only ... ROM BIOS ... then, it must have 12, or 16 bytes format ... Formatting a JTextField to only allow ip addresses?Anybody know of a free custom swing component that represents an IP address. Or does anybody know how to format a JTextField to only allow ip addresses. How do I validate a TextField/JTextField to only accept valid IP ...How do I validate a TextField/JTextField to only accept valid IP addresses? ... I create a IPAddressField class which contains multiple JTextField's which ... 7/22/2012 4:43:29 PM
|