Mapping real coordinates into GUI

Hi every body,

I am new to java but I have good background in C++ .

I want to use java to represent real coordinates on a graphical sequare.

to clarify the idea, I have a square area in real word and there is an object that

located at this square. For example: the location of the object is (2,1) and I want to represent this coordinate on graphical interface.

please see the pic

http://dc402.4shared.com/img/HXffS6l...56825/area.JPG

Is there any tool that may help me to do that? or I should do that manually?

Any help will be appreciated.

Thanks in advanc

Re: Mapping real coordinates into GUI

You can just write a mapping method that takes real-world coordinates and converts them to GUI coordinates. Your GUI display component will have a certain width and height in pixels, and the real-world area you're dealing with will have a certain range, so you can calculate the X and Y factors to multiply by to convert real-world coordinates to GUI component coordinates. For example, if the real-world X range is 10 and the GUI component width is 800, then you'd multiply real-world X values by 800/10 to get the pixel X value, and so-on.

Re: Mapping real coordinates into GUI

Thank you so much :)

I will do something like that

Thanx again :)