Make a object when pressed follow mouse pointer, java [closed]
One way is to make your Ball class an actual Swing component. Then you can use the ComponentMover class. Edit: how do you make a class into a swing component Basically, you move your draw(…) code into the paintComponent() method of JComponent. Here is a simple example that does all the custom painting for you … Read more