Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 830471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:02:58+00:00 2026-05-15T04:02:58+00:00

I had made one module in my project on which user can draw anything

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:02:58+00:00Added an answer on May 15, 2026 at 4:02 am

    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.

    Image cursorImg = new ImageIcon("rectangle.gif").getImage();        
    Point hotspot = new Point(0, 0);     // should be set to the center of your rectangle    
    Cursor cursor = getToolkit().createCustomCursor(cursorImg, hotspot, "cursorname");
    
    YourComponent.setCursor( cursor );
    

    EDIT:

    I have to add that getToolkit() is a method of java.awt.Component

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had made on form, in which i had one text area. Now i
I had made one application in java-swing, Now what i am getting problem is,
I had made changes in a folder called branch, and now that its working
I was creating a module and had made a typo and then got a
I made changes to some files i had in a project (they were auto
I had made one Java Swing based application. On my application,if i click anywhere
I had made a main page and use user component to implement the style
I had problem in my other code and huge, but I had made one
I had made three tables. Table1=users .And the column names are userid (auto_increment) and
I had made a windows service in visual studio 2008 in C#. inside the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.