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.
精彩评论