• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

deprecated API

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Akshay Reddy
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)



 
Marshal
Posts: 77213
370
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to get rid of that warning only without bothering about the deprecation, just use supress warning annotation.

 
Sheriff
Posts: 22716
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Campbell Ritchie
Marshal
Posts: 77213
370
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic