I am trying to create a graph implementation where the graph is displayed on a JPanel.
I am adding and removing vertices without a problem (I am using more panels for these). The problem I am having is adding lines to represent the edges. I know I can use
contentPane.getGraphics().drawLine(x1, y1, x2, y2)
to add a line, but it leaves no way for me to delete that line later on. Any ideas?