Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Java2d 中有一个图像,我希望用户可以通过左键单击并拖动鼠标来选择图像的任何矩形部分。(类似于 mspaint)。这实际上是如何完成的?
谢谢你。
http://java.sun.com/docs/books/tutorial/uiswing/events/mousemotionlistener.html
SelectionDemo 应该特别有用。