how to draw a line between two labels in a panel where labels are added during runtime
Posted
by vybhav
on Stack Overflow
See other posts from Stack Overflow
or by vybhav
Published on 2010-03-28T19:49:36Z
Indexed on
2010/03/28
19:53 UTC
Read the original article
Hit count: 291
A panel contains two labels which are generated by mouse clicks on the panel. I want to connect these two labels by drawing a line between them probably by dragging the mouse pointer from one label to another.
There are two events here - one is clicking on the panel to generate the labels and the second is connecting these two labels (mouse pressed, mouse dragged and mouse released events). Both these event need to call the repaint() method but for different purposes. But there can be only one paint() method. The problem is when I connect these two labels, the line comes up but the rest of the components on the panel disappear.
© Stack Overflow or respective owner