I had made one module in my project on which user can draw anything using a pencil.
Now I want to create an eraser for that drawing module, so I need it so that as soon as the user clicks on that eraser button then around my mouse cursor I want a little rectangle shape around it, so the user can use it to erase some parts in the drawing.
How to do this? Any suggestions?
Instead of drawing a rectangle around the cursor, I would suggest to set a custom curser for the selected tool.
Just to show the API, (not tested) something like that sould work.
EDIT:
I have to add that getToolkit() is a method of java.awt.Component