Forums Register Login

uses deprecation API error

+Pie Number of slices to send: Send
hi,
i have writen a code for selecting text using applet. i have used applet't init()and public boolean action(Event evt, Object arg) . when compiling i am getting an error
" The method boolean action(java.awt.Event, java.lang.Object) in class java.awt.Component has been deprecated, and class select_text(which is not deprecated) overrides it.
public boolean action(Event evt, Object arg){
^
select_text.java uses a deprecated API. Please consult the documentation for a better alternative. 2 warnings"
how should i solve this 2 warning problem.
kindy guide me as iam still a novic.
kindly reply me at my email address konikadey@yahoo.com and konikadey@hotmail.com
+Pie Number of slices to send: Send
Deprecated API's are no longer supported. Sun advises against using them. For your specific question, the Java documentation states:


action
public boolean action(Event evt,
Object what)
Deprecated. As of JDK version 1.1, should register this component as ActionListener on component which fires action events.


If you need information on ActionListener, try looking here in the Java Tutorial: http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html
Next time, please be sure to register with a proper name. "konikadey" does not follow the conventions. See here for details: http://www.javaranch.com/name.jsp
If you do not register properly, your account will be disabled. I would hate to see that happen.
Thank you.
Stephanie
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 816 times.
Similar Threads
Problem: "Can't find resource for bundle..."
Rendering of text on canvas in jdk1.4
error in action method
Enabled Web start in NetBeans, but lost database connection
awt classes
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:29:49.