wood burning stoves
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "AWT" Watch "AWT" New topic


DB Ekanayake

Joined: Apr 07, 2008
Posts: 8

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


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

Joined: Mar 22, 2005
Posts: 42958
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

Joined: Apr 07, 2008
Posts: 8

Thanks Ulf

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


I agree. Here's the link: http://aspose.com/file-tools
subject: AWT
It's not a secret anymore!