I have a drawing panel where I can draw lines etc.
Program works like this:
1. First mouse click makes start point (coordinates) 2. Second mouse click makes destination point (coordinates) 3. Line is drawn between those points 4. Third click draw a line from it coordinates toward center of jpanel
problem is this....
How to make Jbutton RESET, which set panel empty(as it was when program where started)without restarting.
Some ideas: 1 — you can reset the member variables (x1, y1, ...) to be equal or offscreen, eg, -1 so that they are not drawn when the component repaints itself after you call repaint; 2 — you can use a member variable boolean in your paintComponent method which you control from your event code to turn on/off drawing of the lines.