• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

uses deprecation API error

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic