RE: deprecated method - replacement

I am having a problem converting the -deprecated event handler.
HELP <ME> PLEASE!
Does anyone know the best way to convert the mouseDrag method so
that it can still inherit values from the class.
::EXAMPLE BELOW::
public class GRABandDRAG extends Applet
implements Runnable {
public boolean mouseDrag(Event event, int i, int j) {
mouseX = i;
mouseY = j;
dragged = true;
int k = (j - oldy) / dragPixels;
int l = (i - oldx) / dragPixels;
if(l != zoneW && W != 1) {
panRight(l - zoneW);
zoneW = l;
return true;
}

Have your Applet class implement java.awt.event.MouseMotionListener and then add yourself to the MouseMotionEvents list via
// in the applet Constructor
this.addMouseMotionListener( this );
Then in your mouseDragged function, use the code you've got. You'll have to get the x and y cordinates from the MouseEvent that is passed in instead of the x / y that would normally used via mouseDrag.

Similar Messages

  • FInding the Replacements for deprecated methods

    I am new to using the Java environment, having been mostly a VB/VB .NET and web developer...so please forgive me if this is a dumb question:
    I inherited some java code that is an extension to a 3rd party app. It was originally written under JDK 1.2.2 (I think), and I am now trying to recompile under JDK 1.4.2, using the Borland JBuilder X IDE.
    Everything seems to be OK, except that I get two warning messages about deprecated methods:
    getFormComponent().setFormProperties()
    getFormComponent().getAllFormProperties()
    I probably should have checked more, but these names would appear to be standard java classes. What methods should I be using instead? And more importantly, how do I go about looking up the current methods?
    Thanks in advance.

    I was coming to that conclusion as well...unfortunately, the 3rd party SW vendor does not appear to have updated their supplied documentation - all of the code examples still use the deprecated methods, and their HTML help doesn't return anything when I search for the method names.
    Looks like a call to their technical support line...
    THANKS for the prompt reply.

  • Deprecated methods in 10.1.3

    Many methods in 10.1.3 are marked as deprecated.
    For example, class oracle.toplink.publicinterface.Descriptor is replaced by ClassDescriptor and RelationalDescriptor where getQueryManager() is deprecated with no replacement method.
    Another example, in oracle.toplink.sessions.Session interface, method containsObjectInIdentityMap is deprecated and no replacement is specified.
    I understand those deprecated methods will probably be removed in the future TopLink release. My question is: will TopLink provide the functions currently implemented in those methods, i.e. replacement methods?
    Thanks.
    Haiwei

    Haiwei,
    Yes the work done in 10.1.3 to add formal support for non-relational mapping (Object-XML and EIS/JCA) did require some refactoring of the descriptor class. In the end the previous Descriptor class was deprecated in place of a new ClassDescriptor hierarchy. This work is backwards compatible but some of the deprecated methods were not properly Java Doc'd with their new replacement.
    getQueryManager() -> getDescriptorQueryManager() - New method on ClassDescriptor
    All of the cache access methods have been refactored into a new IdentityMapAccessor class. This is available from any session using getIdentityMapAccessor().
    Doug

  • Removing deprecated methods from legacy source?

    What does one do about deprecated methods in legacy code?
    As new versions of the compiler seem to keep supporting the deprecated methods (just offering warnings), there is no reason to invest the resources to update the source? I don't mean methods such as:
    java.lang.Thread stop(),
    I am thinking of methods such as:
    java.awt.Window show();
    Will there ever be tangible consequences to not stopping using deprecated methods? Will code with deprecated methods eventually break?
    Edited by: dpxqb on May 7, 2010 9:50 PM

    There's often an "if it ain't broke, don't fix it" mentality around deprecated methods and classes. Whether that's appropriate or not depends on the individual case. Any deprecated method/class may be removed in any future release, but you have to balance the risk of that happening against the cost of replacing it. Some methods/classes will probably never go away--like Vector, for instance. So there's not much benefit to doing a search/replace on a large codebase.
    It depends on your analysis of the various risks and rewards in your particular situation.

  • After changing deprecated methods in Thread Class

    I have changed the deprecated methods suspend() and stop() with JDK1.2.2 methods wait() and thread = null respectively. I wanted to know the affects after changing when I actually run the application.

    For one thing, "thread = null" won't stop the thread. In fact it will have no effect on the thread at all.

  • Deprecated methods in Interfaces

    Hi all,
    I'm implementing an interface containing some deprecated methods. These deprecated methods have to be implemented, of course. If I compile my implementation I get deprecation warnings for these implemented methods. Does anyone know how I can get rid of these warnings? I've added @deprecated flags to my implementation of these methods, but that didn't solve these warnings. I'm using JDK 1.3.1.
    Thanks
    Daniel.

    Technically it's a feature. :p
    but seriously, the whole deprecated thing is a feature, it's too bad that in this case you have to live with it, but there's no way around it.
    besides it doesn't matter if you call a depreciated method as it is still going to work. It just means that some point in the future it will not be supported. And judgeing by sun's past actions, I would say that it's more of a way to encourage people not to use old methods, but I don't think that they will ever remove the depreciated methods from the api.
    The only methods you have to watch out for are the few like those the Thread which are just not implemented at all. Like thread.destroy()

  • What method replace handler(before jheadstart 9.0.5.1) in jheadstart 10.1.2

    What method replace handler(before jheadstart 9.0.5.1) in jheadstart 10.1.2.0.
    Does anybody tell me how to do it ?
    Thanks for your help.

    The handler layer as provided in JHeadstart before ADF existed, has now been replaced with ADF databinding layer. Whereas in the pre-ADF days, you would add custom methods to JHeadstart handlers, you now add these methods to the application module impl class, and then you can drag and drop these methods onto your page or struts action. The ADF binding layer will ensure that your method gets called correctly.
    You might want to check the following link with more info on adf data binding:
    http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html
    Steven Davelaar,
    JHeadstart Team.

  • How I make deprecated method in JB4

    Hi, i make deprecated method like this:
    * @deprecated
    public String fillCharsToLimit(String value, int limit, char chr, boolean fromFirst) {
    value = value.trim();
    if (value == null || (value.length() == 0 && limit <= 0))
    ;//do st
    (in project properties i enable Show deprecations)
    I except that compiler say me warning.
    Its ignore deprecation in my code, but when I use deprecated method from JDK all is OK, only my method no why?
    Thanks DK

    You don't get a deprecation warning if the deprecated class or method and the code that uses the deprecated class or method are compiled at the same time. See Bug 4216683 http://developer.java.sun.com/developer/bugParade/bugs/4216683.html for details.

  • Parsing failed: TypeError: Cannot call method "replace"

    Hi,
    when i troubleshooting my collector, sentinel GUI message prompt
    following:
    Parsing failed: TypeError: Cannot call method "replace" of undefined;
    input:
    my release.js is following:
    Collector.prototype.initialize = function() {
    this.PARSER.getOffsetData = function(input) {
    if (typeof input.RXMap != "undefined") {
    return input.RXMap.REQUEST_TM;
    conn.addParser(this.PARSER.getOffsetData);
    return true;
    Collector.prototype.cleanup = function() {
    return true;
    Connector.prototype.sendQuery = function() {
    return true;
    Record.prototype.preParse = function(e) {
    if (this.CONNECTION_ERROR != null || typeof this.RXMap == "undefined")
    { return false; }
    if (this.CONNECTION_METHOD == "DATABASE") {
    for (var field in this.RXMap) {
    this[field] = this.RXMap[field];
    return true;
    Record.prototype.parse = function(e) {
    var detstring =
    this.RXMap.REQUEST_TM.replace(/(\d+)\/(\d+)\/(\d{4})\s(\S+)/g, '$1/$2/$3
    $4 GMT');
    var dt = new Date(detstring);
    e.ObserverEventTime(dt);
    return true;
    Record.prototype.normalize = function(e) {
    instance.SEND_EVENT =true;
    return true;
    Record.prototype.postParse = function(e) {
    return true;
    Record.prototype.reply = function(e) {
    return true;
    my sqlquery.base is following:
    SELECT TOP 100 * FROM TS_QUERYBILLSIGNED_LOG WHERE REQUEST_TM > %s
    My table sample is following:
    CUSTCODE,BEGIN_TM,END_TM,PAGEINDEX,QUERYTYPE,SYSTE MNAME,SIGNEDTYPE,CLIENTIP,CLIENTMAC,CLIENTNAME,MET HODNAME,REQUEST_TM,ANSWER_TM,ANSWER_TOTAL,ANSWER_C URRENTCOUNT,LOG_ID,WAYBILL_NOS
    8710294837,12/30/2013,1/2/2014
    23:59,0,0,CSS-CLIENT,0,221.213.26.241,6C-F0-49-CD-2C-CD,a0af75ce888346e,waybillSingedTotal,1/3/2014
    14:50,1/3/2014 14:50,28,4,433676211,
    My table Schema is following:
    USE [sfere]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[ts_querybillsigned_log](
    [CUSTCODE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [BEGIN_TM] [datetime] NULL,
    [END_TM] [datetime] NULL,
    [PAGEINDEX] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [QUERYTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [SYSTEMNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [SIGNEDTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [CLIENTIP] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [CLIENTMAC] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [CLIENTNAME] [varchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [METHODNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [REQUEST_TM] [datetime] NULL,
    [ANSWER_TM] [datetime] NULL,
    [ANSWER_TOTAL] [numeric](20, 0) NULL,
    [ANSWER_CURRENTCOUNT] [numeric](20, 0) NULL,
    [LOG_ID] [numeric](30, 0) NOT NULL,
    [WAYBILL_NOS] [varchar](400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    Thanks
    Best Regards!
    Steve zeng
    steve_zeng
    steve_zeng's Profile: https://forums.netiq.com/member.php?userid=3875
    View this thread: https://forums.netiq.com/showthread.php?t=50290

    steve_zeng;242145 Wrote:
    > Hi,
    >
    > when i troubleshooting my collector, sentinel GUI message prompt
    > following:
    >
    >
    > Parsing failed: TypeError: Cannot call method "replace" of undefined;
    > input:
    >
    > my release.js is following:
    > ----------------------------------------------------------------------
    > Collector.prototype.initialize = function() {
    > this.PARSER.getOffsetData = function(input) {
    > if (typeof input.RXMap != "undefined") {
    > return input.RXMap.REQUEST_TM;
    > }
    > };
    > conn.addParser(this.PARSER.getOffsetData);
    > return true;
    > };
    >
    > Collector.prototype.cleanup = function() {
    > return true;
    > };
    >
    >
    > Connector.prototype.sendQuery = function() {
    > return true;
    > };
    >
    >
    > Record.prototype.preParse = function(e) {
    > if (this.CONNECTION_ERROR != null || typeof this.RXMap == "undefined")
    > { return false; }
    >
    > if (this.CONNECTION_METHOD == "DATABASE") {
    >
    > for (var field in this.RXMap) {
    > this[field] = this.RXMap[field];
    > }
    > }
    >
    > return true;
    > };
    >
    > Record.prototype.parse = function(e) {
    >
    > var detstring =
    > this.RXMap.REQUEST_TM.replace(/(\d+)\/(\d+)\/(\d{4})\s(\S+)/g, '$1/$2/$3
    > $4 GMT');
    > var dt = new Date(detstring);
    > e.ObserverEventTime(dt);
    > return true;
    > };
    >
    >
    > Record.prototype.normalize = function(e) {
    > instance.SEND_EVENT =true;
    > return true;
    > };
    >
    > Record.prototype.postParse = function(e) {
    > return true;
    > };
    >
    >
    > Record.prototype.reply = function(e) {
    > return true;
    >
    > ----------------------------------------------------------------------------
    > my sqlquery.base is following:
    >
    > SELECT TOP 100 * FROM TS_QUERYBILLSIGNED_LOG WHERE REQUEST_TM > %s
    >
    >
    > My table sample is following:
    > ----------------------------------------------------------------------------------
    >
    > CUSTCODE,BEGIN_TM,END_TM,PAGEINDEX,QUERYTYPE,SYSTE MNAME,SIGNEDTYPE,CLIENTIP,CLIENTMAC,CLIENTNAME,MET HODNAME,REQUEST_TM,ANSWER_TM,ANSWER_TOTAL,ANSWER_C URRENTCOUNT,LOG_ID,WAYBILL_NOS
    > 8710294837,12/30/2013,1/2/2014
    > 23:59,0,0,CSS-CLIENT,0,221.213.26.241,6C-F0-49-CD-2C-CD,a0af75ce888346e,waybillSingedTotal,1/3/2014
    > 14:50,1/3/2014 14:50,28,4,433676211,
    >
    > -----------------------------------------------------------------------------------------
    > My table Schema is following:
    >
    > USE [sfere]
    > GO
    >
    > SET ANSI_NULLS ON
    > GO
    > SET QUOTED_IDENTIFIER ON
    > GO
    > SET ANSI_PADDING ON
    > GO
    > CREATE TABLE [dbo].[ts_querybillsigned_log](
    > [CUSTCODE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [BEGIN_TM] [datetime] NULL,
    > [END_TM] [datetime] NULL,
    > [PAGEINDEX] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [QUERYTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [SYSTEMNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [SIGNEDTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [CLIENTIP] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [CLIENTMAC] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [CLIENTNAME] [varchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [METHODNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    > [REQUEST_TM] [datetime] NULL,
    > [ANSWER_TM] [datetime] NULL,
    > [ANSWER_TOTAL] [numeric](20, 0) NULL,
    > [ANSWER_CURRENTCOUNT] [numeric](20, 0) NULL,
    > [LOG_ID] [numeric](30, 0) NOT NULL,
    > [WAYBILL_NOS] [varchar](400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    > ) ON [PRIMARY]
    >
    > GO
    > SET ANSI_PADDING OFF
    >
    > Thanks
    > Best Regards!
    > Steve zeng
    It's throwing an exception because at some point, you are not checking
    your string for nulls before calling replace. My guess is that
    this.RXMap.REQUEST_TM is sometimes empty/null and when you call replace,
    it then excepts. Always ensure that your string value is
    non-null/defined before calling a function against it.
    brandon.langley
    brandon.langley's Profile: https://forums.netiq.com/member.php?userid=350
    View this thread: https://forums.netiq.com/showthread.php?t=50290

  • File handling deprecated method - which one?

    I have this code, it should basically use the lines of text in a file and use them to construct nodes in a JTree. The compilation error is that the class uses a deprecated method - so does anybody know what method is the problem and what I should use?
    private void createNodes(DefaultMutableTreeNode top)
       DefaultMutableTreeNode anode = null; 
       File theFile = new File("categories.txt");
    try
    DataInputStream din1 = new DataInputStream(new FileInputStream(theFile));     
        //while (din1.available() !=0)
        while (true)
           String topic = din1.readLine().trim();
           //set the string as a tree node
           anode = new DefaultMutableTreeNode(topic);
           top.add(anode);
         din1.close();//close the file handle
         catch (Exception e)
              System.err.println("File input error");
    }//end of method

    If you compile with deprecation it will tell you specifically.
    I think it is:
    javac -deprecation ...
    The only method from below that I think it could be is readLine() in DataInputStream...
    If you are reading text...try:
    BufferedReader br = new BufferedReader(new FileReader(theFile));
    String topic;
    while ((topic=br.readLine())!=null)
        anode = new DefaultMutableTreeNode(topic);
        top.add(anode);
    br.close();

  • DocCheck comments on deprecated methods

    I am using the DocCheck utility to check the comments in my java packages, classes and methods. Methods that are deprecated have a @deprecated tag in the method comment, but DocCheck then complains about missing @params, etc. Is there any way that I can suppress the checking of deprecated methods?

    was just giving the way old doccheck tool a try - found it to be really useful
    and I ran into the problem mentioned here, I wished, doccheck wouldn't check deprecated methods ...
    so, what has happened to
    ericArmstrong wrote:
    I'll add it to the list of desired features, and give it
    a high priority.;-)
    Anyone still using doccheck? Are there any other tools, I mean, maybe doccheck will fail on some javadoc features introduced with Java 5 or 6 or ... 11 ;-)
    I like it! E.g., it gave me hints, to add @see in my getter and setter methods ... cool stuff!
    Merten

  • 1.4 deprecated methods

    Are there any methods that have been deprecated as of JDK 1.3 that have been removed in JDK 1.4 / 1.4.2? I can't find a list anywhere. Generally, do we need to worry about Sun completely removing deprecated methods?

    Woohoo! I wonder how long before the move to 1.5 happens.<thinks about how wonderful moving data structures
    consisting of 6 nested hashtables into generics will be/>
    *splort*
    Exactly! I've already thought about that. But, probably no worries--the contract has ended. What is supposed to be the last release is supposed to happen in a couple of days (once they fix a problem with a data file the subcontractor gave us). Our code to parse their text file (one time thing as part of a build) didn't have much error checking, so the error wasn't found until the testers tried to run something else. Then, the first person debugging it tried to find a latent bug in our code (spend a few days on it). They called me up today (I'm on another project now) to see if I could find anything, because the other guy was out for two days. As soon as I saw where the error occurred, I looked at the data files and quickly found that they were corrupted. Our code is still fragile, but if the data file is fixed, that should be sufficient (might as well keep this part fragile, especially if the contract is over--everything else in the code is fragile, too).

  • Deprecated Methods and NoClassDefFoundError

    Hi,
    I wonder if using deprecated methods in a Java program could cause java.lang.NoClassDefFoundError?
    I have a Java program with a few deprecated methods. The program worked well when I last ran it about half a year ago. But it shows java.lang.NoClassDefFoundError (Exception in thread "main"
    ) every time I try to run it recently.
    p/s: I use netBeans to run my program.

    Hi,
    I wonder if using deprecated methods in a Java
    program could cause java.lang.NoClassDefFoundError?
    I have a Java program with a few deprecated methods.
    The program worked well when I last ran it about half
    a year ago. But it shows
    java.lang.NoClassDefFoundError (Exception in thread
    "main"
    ) every time I try to run it recently.
    p/s: I use netBeans to run my program.Hi,
    No, the problems seems to be your classpath, and not the fact that you are using deprecated methods.
    Kaj

  • Deprecated Method's Replacement in NW7.3

    hi,
    In version 7.3 of NW, following methods seem to be deprecated. Please suggest their replacements.
    mappingOfOnAction().addParameter
    wdComponentAPI.getWindowManager().createConfirmationWindow
    com.sap.tc.webdynpro.services.session.api.IWDConfirmationDialog
    wdComponentAPI.getMessageManager().reportMessage
    wdComponentAPI.getMessageManager().reportException(
           e.getLocalizedMessage(), true);
    WDWebResource.getWebResource
    Thanks !
    seventyros
    [Learn SAP Online|http://learnsaponline.blogspot.com]

    move your mouse over it. i think it will give some idea
    or ctrl+click, check the api doc

  • Deprecated methods

    The following method has been deprecated. Does anyone know what it is replaced with? Also, is there a list of what has been deprecated and what the replacement method is and how to implement the replacement method?
    •     Warning(1886,24): setSelectedItemToStringConverter(oracle.bali.inspector.editor.ToStringConverter) in oracle.bali.inspector.PropertyEditorFactory2 has been deprecated
    Thanks

    Hi,
    such documentation should be part of the JavaDoc unless the developer deprecating the method forgot to mention it. There is no other documentation than that to provide the information. The JavaDocs say:
    * @deprecated use {@link #setEditorComponentInfo(EditorComponentInfo)} instead.
    So its in the same class
    Frank
    ps.: Hope you know what you do because I am not sure bali classes are open for public consumption

Maybe you are looking for

  • How do I get past the request to turn off Itunes.

    Hi people, Sorry if this question has already been answered. I tried to find some help on the forum but the question may have been asked a different way and I couldn't find it. So my problem, I have downloaded xcode_3.2.6_and_ios_sdk_4.3.dmg and it i

  • Oracle R12 forms not launching

    Hi, I am trying to access R12 (12.1.3) apps using Windows7 with IE8 and JRE version 1.6.0_07 which is supported. I am having issues with launching forms. There is no error message as such in the console window but the forms window does not come up. C

  • ITunes U RSS feeds and Firefox Live bookmark

    It seems there is a problem with rss feeds and ffox live bookmarks. I tried subscribing to - http://deimos3.apple.com/WebObjects/Core.woa/Feed/itunes.stanford.edu.1524698736 .01524698739. However I do not get the plus sign indicating there are additi

  • Oracle Devloper Help

    HOW CAN I RESTRICT TO USER THROUGH ORACLE DEVELOPER FORMS THAT HE/SHE CAN OPEN ONLY ONE SESSION I THINK Win_Api_Session.One_Session MAY BE USED FOR THAT,BUT IT GIVES ERROR WHEN I TRY TO USE IT. SIMILARY Win_Api_Environment.Get_Windows_Username GIVES

  • On-line funds checking with respect to project budgets

    Hi Friends, Does Purchasing check, in addition to available funds in GL, the funds available in a project if at PO level, the project number is set up and an expenditure type is attached and a Project Budget is setup for the expenditure type. What ar