Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

validating JTextField for empty  RSS feed

 
Anand Shrivastava
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,

I have made a JTextField and want to validate it for being empty. I have written the following code using InputVerifier as anonymous inner class.
Kindly see :

This Code is in class Dmemoscreen.
However, on compilation I get the following eror message
javac -d . -g -deprecation -sourcepath D:\hosp -classpath .;D:\hosp;d:\hosp\drugstore;"C:\Documents and Settings\Lenovo\My Documents\New Folder\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.2\enu\sqljdbc.jar" Dmemoscreen.java

Dmemoscreen.java:58: <anonymous Dmemoscreen$1> is not abstract and does not override abstract method verify(javax.swing.JComponent) in javax.swing.InputVerifier

{

^

1 error

Kindly help.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the error message states
"does not override abstract method
verify(javax.swing.JComponent)", whereas your method signature is
verify()
 
Anand Shrivastava
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!