• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uses deprecation API error

 
konikadey
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic