Results 1 to 3 of 3
- 06-22-2010, 04:00 AM #1
Member
- Join Date
- Jun 2010
- Posts
- 17
- Rep Power
- 0
How to fix Deprecated ApI warning in java program
I make the following programs,when i compile the error comes:
Error:C1.java uses or override a deprecated API ,Recompile with -Xlint:deprecation for detailes;
import java.awt.*;
class C1 extends Frame
{
C1()
{
Label l1,l2;
TextField t1,t2;
l1=new Label("Name");
l2=new Label("Qual");
t1=new TextField(30);
t2=new TextField(30);
set.Layout(null);
l1.setBounds(20,20,50,30);
l2.setBounds(20,130,50,30);
t1.setBounds(50,50,30,30);
t1.setBounds(150,130,30,30);
add(l1);
add(l2);
add(t1);
add(t2);
show();
}
public static void main(String args[])
{
new C1();
}
}
Somebody help///
- 06-22-2010, 04:04 AM #2
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
Read the Java API for that class and that method. It will usually tell you what to do instead. In this case likely the class will be Frame and the method show().
Also, if you don't have a contraindication towards doing so, I strongly urge you to change from an AWT GUI to a Swing GUI and that you look into using layout managers rather than a null layout.
Suerte amigo!
- 06-22-2010, 04:05 AM #3
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
Similar Threads
-
Dont use this program, Im warning you!
By Addez in forum JCreatorReplies: 3Last Post: 11-28-2009, 07:18 PM -
deprecated method.. help!
By iuna in forum Java AppletsReplies: 11Last Post: 09-08-2008, 08:38 PM -
Java Security Warning
By Neil in forum New To JavaReplies: 3Last Post: 09-01-2008, 04:15 PM -
I need help with a deprecated program
By mikau in forum New To JavaReplies: 0Last Post: 02-13-2008, 09:34 AM -
Using Deprecated Methods
By ravian in forum New To JavaReplies: 3Last Post: 11-23-2007, 07:58 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks