rohith yenumula wrote:Thanks pete for taking your time off. One thing that worries a bit is how to enable the user to draw lines between the two icons. If you have any idea please share it.
Myself, I'd have a non-GUI model that knows what the icons represent and their location as well as knows about and manages the connection lines. I'd have a drawing JPanel that uses this model to draw the icons in their positions as well as the connection lines. I'd give this JPanel both a MouseListener and a MouseMotionListener both of which use the same MouseAdapter object. The MouseAdapter would create tell the model to create the icons on mouse press and to create the connecting lines on mouse drag (if the start position is near one icon and the end position near another) and then would call repaint which would ask the paintComponent method to use the model data to update the image.