This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Java uses or overrides a deprecated API? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java uses or overrides a deprecated API?" Watch "Java uses or overrides a deprecated API?" New topic
Author

Java uses or overrides a deprecated API?

Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 507

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



[Thumbnail for Untitled.png]


Are you better than me? Then please show me my mistakes..
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4003
    
  18

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.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 507

That was a quick reply. Thanks a lot for your help.... I really appreciate that.....
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20083
    
  30

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Java uses or overrides a deprecated API?
 
jQuery in Action, 3rd edition