I want to draw a line between different components in a JPanel, but the line should be a component, ie, it can be clicked, highlighted, selected and deleted instead of just painting a line in a panel, is there anything like this or I must implement it by myself. And if I must implement it, how?
Share
I tried to use prepared things like
JSeparator, But I found the best way by myself and I implement it. I used aJLayeredPanefor my container. I add my ownJPanelbehind the all layers and override itspaint()method. inpaint()method I used Java2D to draw a curve between Components on higher layers inJLayeredPane. You can see the result in below.