# java.awt.MouseInfo no longer works?



## C0B01 (Jan 6, 2005)

Im writting an app that uses a thread to periodically get the mouses current x and y coords. Ive searched the net and found that others have had this problem too.. the solution i found was using the "import java.awt.MouseInfo;" and using the integers:


int previousX = MouseInfo.getPointerInfo().getLocation().x;
int previousY = MouseInfo.getPointerInfo().getLocation().y;

Ive tried to implement this... but it says its a depreciated sdk 1.5 .. now using 5.0 it doesnt work.. is there another way to get the current coords? ( im NOT using the mouseEvent, pressed, released, entered, exit.... bla bla)

Any help?


----------



## beer_city_sk8 (Apr 11, 2006)

i believe that pretty much all awt is heading towards obsoletion, i think it is because it worked very well on windows api's and very crappily on others, so they created javax so you could create programs that were platform specific to the more popular platforms or it allowed you to use an all platform java format which is used for pretty much all java applications nowadays. im a little rusty but i think that you should stop using awt and look into javax. i'm sorry i dont know a good site to learn the javax class, i believe that the java website will have a tutorial, forum, or just raw info on it.


----------

