How to generate events from graphics generated by Java2D
问题 I have made an Ellipse with the help of java.awt.geom.Ellipse2D Now, I want that whenever user clicks on that ellipse, an event is generated so that I can listen to that event and peform subsequent tasks based on the ellipse which generated that event. 回答1: Here is a simple example of an object drawing program that demonstrates click, drag and multiple selection. Also consider JGraph, which is a much more advanced library for graph visualization. 回答2: I'm going to assume this is a question