This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am trying to make a graphing package for Swing. By graphing, I mean a set of nodes laid out with the vertices connecting them. I have built a custom layout manager to properly lay out the nodes (which are JComponents, just think of them as Buttons). However, I do not know what to do with the edges. Since they are just straight lines, I think that I should just call drawLine() However, I'm not sure where to do this. If I make a custom panel that does all the drawing, then I have both the panel and the layout manager to worry about (increase coupling). However, if I have the layout manager draw the lines, I think that would be a violation of what the layout manager is supposed to do. I'm not even sure the layout manager can draw lines. Give me any advice you have, I'd welcome any suggestions. Micah