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 AWT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "AWT" Watch "AWT" New topic
Author

AWT

DB Ekanayake
Greenhorn

Joined: Apr 07, 2008
Posts: 8
Hi

I get the following form a Java Tut and compile on My Win Xp Mechine.
Compiler gives following massages:
Note: HowToWindow.java uses or overrides a deprecaed API.
Note: Recompile with -Xlint eprecation for details.

But it runs correctly and gives the particular out put

Please Help Me

Thanks

import java.awt.Frame;
import java.awt.Label;
public class HowToWindow extends Frame{
public static void main(String arg[]){
new HowToWindow();
}
HowToWindow(){
Label label;
label=new Label(" How To");
add(label);
pack();
show();
}
}
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42912
    
  68
It's a warning, not an error - that's why you have no problems running the code.

Sometimes certain methods or classes of the Java API are made "deprecated". That means they shouldn't be used any more, and that there is a better alternative for achieving the same goal.

If you compile with the "-deprecation" flag the compiler will tell you in detail which methods are deprecated. In this case it's the "show()" method. Generally, the javadocs of the deprecated methods/classes will tell you what you should use instead.
DB Ekanayake
Greenhorn

Joined: Apr 07, 2008
Posts: 8
Hi

Thanks Ulf

I Learned much about the Deprecation from JavaDocs.
show() is replaced by setVisible(boolean).
Now my codes work pretty.

Thanks

DB
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AWT