Verify JtextFiled in java Swing -
i new java language: want know if want how can check input value of text filed , verify it. if verified insert data base if not verified not actions. show error message. question that: 1 of field id , want define id unique number. here code:
i want know if want how can check input value of text filed , verify it
there number of ways might achieved this...
you could...
- use
inputverifier
, discussed in how use focus subsystem, validating input, allows post validation on field - use
documentfilter
, discussed in implementing document filter , documentfilter examples, allows real time validation - use
jformattedtextfield
, how use formatted text fields and/orjspinner
, how use spinners, allow restrict user can enter, is, again, post validated. - just run through list or array of fields , verify each 1 when user hits "save" button, frank, bad idea , plain annoying.
if verified insert data base
this come down how implement validation routines, should @ jdbc(tm) database access basics of interacting databases...
but if not verified not actions. show error message
start taking @ how make dialogs
another question that: 1 of field id , want define id unique number
generally speaking, database should take care of record identities/keys/ids, take care of multi user access , further prevent possibility multiple users try , use same id...
Comments
Post a Comment