• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Extending JTextField for binary-only data?

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Trying to find an example of a JTextField that only accepts 1's and 0's in groups of 4 where several groups are separated by spaces (ie. 0000 0000 0000 0000). Also wanting to find a JTextField extended to accept data in the format of an IP Address with the dots already inserted.
Anyone here know where to find such a beast or have already extended the JTextField in a similar manner?
 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check out sitraka.com
 
Lon Allen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Sitraka used to be the KLGroup. I was hoping to learn by example how to do this myself. I wasn't wanting to have to purchase a library to get this done.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out Sun's Tutorial on creating GUI's... How To Use Textfields. There are some examples in there that should help you out on this topic.

-Nate
 
Lon Allen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nathan. That helps some, although I am already validating some fields in this way. What I am really interested in, and maybe nobody here has done this, is using editMasks and displayMasks to preformat the fields in the first place (ie. the spaces in the binary formatted data or the periods in the IPAddress). I an new to these ideas (they are Borland methods) and not sure how to implement them. I was hoping that someone here had done it in a different way. I don't want the end-user to have to type the periods or spaces in the fields. And if they do all they end up getting is the cursor placed on the next element that they can edit in the field.
thanks again...
 
reply
    Bookmark Topic Watch Topic
  • New Topic