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