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.