• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

urlyBird 1.2.3 - customer holding record

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For my gui , i have a text box , where use can enter the customer id number.

The spec says it should be 8 digit number?

I am guessing then it should be between 0 through 9 and legth = 8..

I was thinking about doing some kind of screen validation.. extends the Jtextfield and create my custom textfield class..it is out of scope for this exam?

thank you.
 
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Payal Shah wrote:

I was thinking about doing some kind of screen validation.. extends the Jtextfield and create my custom textfield class..it is out of scope for this exam?



Either way, just document your decision. I didn't implement that mechanism.

Jeffry Kristianto Yanuar (Java Instructor) SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2)
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did implement it. I have a JTextField, where the user can only insert numbers from 0 to 9, and only up to 8 numbers.
 
Payal Shah
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Jeffry and Roberto.


regards,
Payal
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


...extends the Jtextfield and create my custom textfield class..it is out of scope for this exam?



But to do this you don't have to extend JTextField.
You could use javax.swing.text.MaskFormatter:



(The '#' means that just numbers can be inserted).

And than, use it with a JFormattedTextField.
 
Payal Shah
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Alexandre,

Ya. that's what i was thinking. I saw the example in Andrew's book. I am gona try it out.

thank you so much for your reply..


Regards,
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic