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 6568931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:33:47+00:00 2026-05-25T14:33:47+00:00

I am currently developing a paint-like application for GWT. I would like to add

  • 0

I am currently developing a paint-like application for GWT. I would like to add a mouse handler that runs when the user drags the mouse across the canvas(like making a square,etc;), the problem is that I’m not surewhat handler to use. Looking through the handlers implemented in canvas has lead me to some hints, but the documentation as to what event the apply to is scant.

Does anyone know how I should implement it? Thanks.

  • 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-25T14:33:48+00:00Added an answer on May 25, 2026 at 2:33 pm

    There is no “dragging” handler. You imlement “dragging” with MouseDown, MouseMove and MouseUp events.

    class YourWidget extends Composite
    {
        @UiField
        Canvas yourCanvas;
    
        private boolean dragging;
        private HandlerRegistration mouseMove;
    
        @UiHandler("yourCanvas")
        void onMouseDown(MouseDownEvent e) {
          dragging = true;
          // do other stuff related to starting of "dragging"
          mouseMove = yourCanvas.addMouseMoveHandler(new MouseMoveHandler(){
                public void onMouseMove(MouseMoveEvent e) {
                    // ...do stuff that you need when "dragging"
                }
          });
        }
    
        @UiHandler("yourCanvas")
        void onMouseUp(MouseUpEvent e) {
          if (dragging){
              // do other stuff related to stopping of "dragging"
              dragging = false;
              mouseMove.remove(); // in earlier versions of GWT
              //mouseMove.removeHandler(); //in later versions of GWT
          }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application that draws map. Currently my logic looks like this:
I am currently developing an approval routing WCF service that will allow an user
I am currently developing a Rails application using a database that was designed before
I'm currently developing a PHP application that's using an Access database as a backend.
I'm currently developing an application that is comprised of five separate executables that communicate
I'm currently developing an iPad application that integrates MapKit. But I have a small
I'm currently in the process of developing a digg-like Ruby on Rails application for
I have a multi-tenancy application that I am developing and I'm nearly there. Currently
I am developing a windows forms application with multiple forms. I would like to
I'm developing an application that requires testing email. I'm currently using wampserver, but it

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.