Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Depricated code...Need help

  1. #1
    Junior Member
    Join Date
    Oct 2017
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Depricated code...Need help

    I have found a really old code which has a deprecated java method.How do i convert into new method.

    public boolean mouseDown(Event e, int x, int y)
    {
    //code
    }

  2. #2
    Member
    Join Date
    Aug 2017
    Location
    Northern Ireland
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Depricated code...Need help

    Does the deprecated method have any JavaDoc with it that gives a suggestion of what has replaced it? Perhaps check the JavaDoc online for the JDK you're using.
    Tim Driven Development

  3. #3
    Member
    Join Date
    Apr 2014
    Posts
    92
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default Re: Depricated code...Need help

    That's an old AWT event listener callback. From Java 1.0! Did you find this project in a museum?

    The Swing version of that method is:
    public void mousePressed(MouseEvent e) {
    	int x = e.getX();
    	int y = e.getY();
    }
    The other one is mouseReleased(MouseEvent e).

    My gut tells me there are dozens of other deprecated method usages in that project as well. Sounds like a nasty chore. If you have to convert the entire application over to using Swing, then I'd strongly consider whether starting from a new Swing project would make more sense.

Similar Threads

  1. Replies: 6
    Last Post: August 5th, 2014, 11:19 AM
  2. Replies: 3
    Last Post: April 27th, 2013, 07:19 AM
  3. Replies: 4
    Last Post: January 24th, 2013, 11:20 AM
  4. Replies: 7
    Last Post: January 24th, 2013, 10:41 AM
  5. Replies: 5
    Last Post: November 14th, 2012, 10:47 AM

Tags for this Thread