Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 411
Yatendra Avatar asked Feb 02 '26 10:02

Yatendra


1 Answers

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.

like image 61
trashgod Avatar answered Feb 03 '26 22:02

trashgod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!