开发者

java move image with mouse

i want to put this image on a map, so i want:开发者_JS百科 - click a button and make a new image - move the image with the mouse and when click the image must be on the jpanel and not move anymore.


Use the jpanel as a canvas to draw the map and the image at a certain position.

Listen to the mouse move events, change the position of the image to the current position of the mouse. Redraw the canvas.

Add a mouse click listener and when you get a click, disable the mouse move listener.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜