File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes deprecated API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "deprecated API" Watch "deprecated API" New topic
Author

deprecated API

Akshay Reddy
Greenhorn

Joined: May 14, 2009
Posts: 21
heyy i am unable to understand this,



for this code the error message is

a deprecated API in line 32 --- that is the frame.show() is long back Deprecated it seems

my laptop has jdk1.6 and it show the deprecated warning in my laptop

while my friend has jdk 1.4 and it is fine there.....what is the alternative to remove this warning message in Jdk 1.6
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Assuming LiftSimFrame extends java.awt.Window you need to use the setVisible(boolean) mehod. When you get a deprecation warning you need to check the JavaDocs, they wioll tell you the method that is replacing the deprecated one.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Akshay Reddy
Greenhorn

Joined: May 14, 2009
Posts: 21
So , do you want me to do this....as you can see,
I have imported the java.awt.window package and i have changed frame.show() to frame.setvisible(true)



Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Abhinav Atla wrote:So , do you want me to do this
What we really want you to do is to look at the show() method documentation and see what it recommends there.
chandrakant karale
Ranch Hand

Joined: Nov 21, 2007
Posts: 41
If you want to get rid of that warning only without bothering about the deprecation, just use supress warning annotation.

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

Which is a bad idea for deprecated code. It's deprecated for a reason, and should not be used at all unless you really, really have to. And you don't have to unless you are implementing an interface with deprecated methods (like java.sql.ResultSet).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
To add to what Rob says, there are some deprecated methods which are positively harmful, so you need to know they are deprecated and not use them.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deprecated API