• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drag and drop line JComponent1 - > JComponent2

Suletea Dorin
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy .
I am building a graphical drawing tool (for Unified Modeling Language and related stuff) but i am stuck and i would really appreciate any help regarding this issue.

Each of my components drawn on canvas have attached a panel with a button on it. The desired behavior is , i press the button , and keeping the mouse pressed i point it to another component , then release it , and the line is drawn.

I tried to accomplish that via MouseListener using onPressed and onReleased functions but since the press event occurs on a button and release occurs on a component i can not treat these 2 separate events as a single functional entity (when i try to release the mouse over a component nothing is happening because the mouse was not pressed on that component).

If any one ever done something like this oh has a clue what to do please do tell



for the button and i will not post the entire Entity class because it contains LOTS of unrelated to the issue code , just the event :

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic