aspose file tools*
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
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: 499

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: 3647
    
  16

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

Joined: Oct 07, 2010
Posts: 499

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

Joined: Oct 27, 2005
Posts: 19696
    
  20

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
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java uses or overrides a deprecated API?