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
}
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.
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
}
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
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:
The other one is mouseReleased(MouseEvent e).public void mousePressed(MouseEvent e) { int x = e.getX(); int y = e.getY(); }
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.