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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:56:28+00:00 2026-05-17T23:56:28+00:00

I wrote an application where you can drag left and right some timeline. When

  • 0

I wrote an application where you can drag left and right some timeline.
When i do dragging i know that this is a mouseDragged event. Since i move mouse cursor outside component it stops dragging, but i don’t want that.

So i want to somehow lock mouseDragged event on that component, but if i move cursor outside component, i don’t get mouseDragged event anymore.

How can i solve that? My colleague tell me that there exists some function like captureMouse.

  • 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-17T23:56:28+00:00Added an answer on May 17, 2026 at 11:56 pm

    I don’t think it’s such a good idea to capture the mouse. I also don’t think it’s necessary for what you want.

    In my experience, mouseDragged() events work fine even when you move the mouse outside of the component area: it will continue to report the X and Y positions inside the component that are closest to the mouse’s location outside of the component, but it won’t terminate the mouse drag as if you had released the left button.

    If the behaviour of your application is different, maybe you’ve got a different bug in your mouse handling?

    For example, try out the applet half way down this page: you’ll see that you can start dragging the rectangle and move your mouse outside of the applet area, and it will continue to work:
    http://www.dgp.toronto.edu/~mjmcguff/learn/java/04-mouseInput/

    (I don’t know the author of the code above; it’s just one of the first I found with a search of java applet mousedragged.)

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

Sidebar

Related Questions

Possible Duplicate: How can I write a Java application that can update itself at
In my Rails 3 application users can write messages/posts in forum. I would like
I wrote a small executable in C# .NET that manages a .jar file. Our
I dont know if what i am asking is possible or not. That is
I'm trying to write my flex application so that it restores the user's settings
I'd like to write a PhoneGap application that keeps a gigabyte of locally cached
I have a small issue. Sometimes when I debug an application I want to
I wrote two simple programs server and a client using sockets in C++ (Linux).
I'm new to VBA but I'm trying to get a DYMO LabelWriter to work
I'm very new to Applescript but have used other scripting languages over the last

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.