• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Help Please  RSS feed

 
Greenhorn
Posts: 2
Java Oracle Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
could any one tell me what to do with that or what i did wrong

when compiling that code



i get this message

SimpleFrameTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Tool completed successfully


what should i do?

thanks

[Edit - added code tags - see UseCodeTags for details]
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohamed. Welcome to The Ranch!

A deprecated function is one that still works, but is not recommended for use any more, and may be removed in a future version. What should you do? Well, for a start you can follow the advice given. If you recompile using -Xlint:deprecation as a compiler argument then it will give you a bit more information about which bit is deprecated.

In this case, it's the show() method. If you read the Javadocs for that method, they will tell you:
Deprecated. As of JDK version 1.5, replaced by setVisible(boolean).

So while you don't have to do anything (this is a warning, not an error), using that replacement will make the warning go away.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the future, please UseAMeaningfulSubjectLine.(⇐click)

Thanks!
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The other thing you should do is follow a more up-to-date book or tutorial .
 
Mohamed Sabry Ali
Greenhorn
Posts: 2
Java Oracle Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks A lot ((Matthew Brown )) Relay Appreciate your help
any material suggestions ?
 
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sabry Ali wrote:
any material suggestions ?

I'd suggest these: Oracle's Java tutorial, Swing (part of the former tutorial actually)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!