Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Note: Recompile with -Xlint:deprecation for details.

843810Feb 8 2006 — edited Jul 1 2010
Hi Everybody,

I am currently using the JDK1.5 Edition and whenever I compile the following piece of code :
===================================================================================
import java.applet.Applet;
import java.awt.*;

public class Applet5 extends Applet
{
String s;
Label l1;
Checkbox c1, c2, c3, c4;

public void init()
{
setLayout(new GridLayout(5,1));
l1 = new Label(" ");
c1 = new Checkbox("1");
c2 = new Checkbox("2");
c3 = new Checkbox("3");
c4 = new Checkbox("4");
add(c1);
add(c2);
add(c3);
add(c4);
add(l1);
}

public boolean action(Event e,Object o)
{
int i=0;
if(c1.getState())
i=i+1;
if(c2.getState())
i=i+2;
if(c3.getState())
i=i+3;
if(c4.getState())
i=i+4;

l1.setText(String.valueOf(i));
return true;
}
};
===========================================================================
I get this message :
---------- Compile ----------
Note: Applet5.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Output completed (5 sec consumed) - Normal Termination
==============================================================================
Can anybody please tell me what I am doing wrong and what "Recompile with -Xlint:deprecation for details." actually means?

I will be really glad if anybody could help me on this fast.

Also, I am able to execute the code the way I want, so really not able to figure out how the above "Compilation Note" affects my program and is there anything I need to care of ?

Thanking you in anticpation.

Yours truly,
Bhavesh S.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2010
Added on Feb 8 2006
11 comments
22,432 views