Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java uses or overrides a deprecated API?

 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please have a look at the following two set of codes

BatchUpdates.java




BatchUpdatesSQL.java



when I am compiling the BatchUpdates.java file, I get the error "BatchUpdates.java uses or overrides a deprecated API ". The complete error is attached here as an image file. Please help me. Thanks

Untitled.png
[Thumbnail for Untitled.png]
 
Stephan van Hulst
Bartender
Pie
Posts: 5912
66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPasswordField.getText() has been deprecated. You should use JPasswordField.getPassword() in your action listener instead.

You can figure this out for yourself by compiling with "javac BatchUpdates.java -Xlint:all"; which will show all the compiler warnings.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was a quick reply. Thanks a lot for your help.... I really appreciate that.....
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:You can figure this out for yourself by compiling with "javac BatchUpdates.java -Xlint:all"; which will show all the compiler warnings.

The -Xlint:deprecation that the compiler itself suggested would have sufficed for this warning.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic