Clicking on a drawn object
Never override paint() in JPanel rather paintComponent(..) Im not quite sure I understand however I made a short example which I hope will help. Basically it is a simple JFrame with a DrawingPanel (my own class which extends JPanel and the shapes are drawn on). This panel will create shapes (only 2 for testing) add … Read more