Skip to main content
gamedev.net
🔒 Locked

[java] Getting Relative Mouse Data

Started by Tongues 0 replies 300+ views
Original Post
Tongues
Tongues
I'm using Java and I need some help getting basic mouse data. Here's the situation: Say I have a 400 x 400 JPanel in the middle of a 500 x 500 JFrame. The JPanel has string drawn to it that prints out the mouse coordinates. If my mouse were placed exactly in the middle of the JFrame, the string should read (200, 200). What is the best way to accomplish this? Thanks!
Brandon Tom, SCJPtomk002@hawaii.rr.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.