开发者

Suitable widget for drawing a 2D cartesian coordinate system in java

开发者 https://www.devze.com 2023-02-05 07:03 出处:网络
I want to build up a GUI area whe开发者_运维问答re users can click randomly. Then I want to retrieve the cartesian (x,y) coordinates of those points where the user clicked. Which GUI component is suit

I want to build up a GUI area whe开发者_运维问答re users can click randomly. Then I want to retrieve the cartesian (x,y) coordinates of those points where the user clicked. Which GUI component is suitable for my task. Also, I want to have any point as big as a usual dot (maybe 3 pixels or more - does this depend on resolution? And if I change the screen resolution of the monitor during the program execution, does the coordinate change?)

I usually work in web programming and I am totally novice in this area. Any pointers to good background reading would help greatly.

Thanks.


http://download.oracle.com/javase/tutorial/uiswing/events/mouselistener.html Is this what you're searching for?

as for changing resolution, I believe you need a listener which changes/updates the size, though I'm pretty much not familiar with that, sorry.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号