Graph, Drawing and my mouse. How do i do it?
I am currently attempting to write an application that allows me to draw a graph. I want the user to be able to click on the parts of the screen that they want to draw it (much like a paint application). I also want the users to be able to move the components of the graph as well as delete components. The application will be used to display traffic flow data so each vertex represents a junction and the link represent roads.
I have attempted to create a custom vertex component that extends Jbutton (to have the functionality of being able to click on and move it around etc). I have modified the paintComponent method to display the component how I like (just a simple 10 pixel dot, although it could change).
When I click the panel to draw it normally draws in the wrong place, always around 40 pixels higher up, when I resize the window they all disappear, but when i click to draw one they all reappear but now it draws it even higher up.
I抦 starting to get more and more baffled and I fear that I抦 going to go insane.
I feel that there is no need to upload my code because it抯 not really working.
My question really is what is the best way to tackle this problem , where do i find information and have i gone about it all wrong?

