views:

41

answers:

1

Hi,

I have a image in Java2d and I would like user to give an option to select any rectangle portion of the image by left clicking and dragging the mouse.(similar to mspaint). How is this actually done?

Thank you.

+4  A: 

http://java.sun.com/docs/books/tutorial/uiswing/events/mousemotionlistener.html

SelectionDemo should be particularly helpful.

Anton