• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[URLyBird] gui user input validation

 
Jan Spitzer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fellow ranchers!

I'm currently working on the frontend for my SCJD (URLyBird 1.2.3) but got stuck on the topic of input validation in the configuration windows, where hostname, port, and db-file are selected.

There are three different options that come to my mind:
  • use a document listener to validate the input fields with every keystroke and display errors in the status bar
  • wait until input is used and show an error message box if validation fails
  • use key listeners to filter all invalid port numbers and make the dbfile textfield uneditable

  • Obviously the second solution is the easiest to implement so I'd prefer it. I just wanted to ask the successful SCJD's how they handled this problem.

    Thanks in advance,
    Jan
     
    Alecsandru Cocarla
    Ranch Hand
    Posts: 158
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    4. use a Document which disallows any input except valid integers
     
    John Grabowsky
    Greenhorn
    Posts: 26
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Jan,

    Easiest is best. Only for long inputs, eg. a text processor, i would prefer continous verification. Maybe helpful:
    http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#inputVerification
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic