How to create events from graphics generated by Java2D

I created Ellipse using java.awt.geom.Ellipse2D

Now I want that whenever a user clicks on this ellipse, an event is created so that I can listen to this event and form subsequent tasks based on the ellipse that generated this event.

+3
source share
3 answers

Here is a simple example of an object drawing program that demonstrates clicking, dragging, and multiple selection. Also consider JGraph , which is a much more complex library for graph visualization.

+3
source

, ( - , ).

, . , .


:

: https://scenegraph.dev.java.net/ google : scenegraph java . Scenegraph JavaFX, Java ( FX)

+1

, , , , - Swing, Graphics2D.draw.

, , .

:

+1

Source: https://habr.com/ru/post/1727615/


All Articles