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

  • Home
  • SEARCH
  • 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 3486060
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:58:59+00:00 2026-05-18T10:58:59+00:00

I have a grid layout with image nodes and I want to add in

  • 0

I have a grid layout with image nodes and I want to add in my application the dnd functionality, for example when I drag and drop an image node to an target JPanel make some actions for example show in original size, delete etc. I have achieve this with to ways one with transferhandler and one with the DropTargets, DragSource etc.But I have two questions and I want to discuss them with you.

a)Which of the two ways it’s better to use? I understand that the second way give me more features than the TransferHandler and the first it’s simplest to use. But I can do my work both of these ways, there is a more effective of two, or it’s all about what I prefer to code.

b)While the dragging occurs I want to display an image near the cursor. The first though I make is to use the glassPane of the JFrame and create a JCompoment which paints proper image and follow the cursor.Can I make it with this way? After this I see in the documentation that the startDrag method of the DragSource get an dragImage argument, is this for the reason I want, I try to pass an Image but I not see any results.

————–UPDATE———————

For the second question (b) I tried with the glasspane but I have problem in the interworking between java DND and my listeners for display the image thumb in the glasspane. each time only one of them work properly.

!!!
More Specifically the mouseDragged event not fired when I have already call the startDrag() method

Thank you for your time.

  • 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-18T10:58:59+00:00Added an answer on May 18, 2026 at 10:58 am

    Solved

    Finally, I find the solution myself.

    If anyone has the same problem I say that the point is that after the startDrag() method fired all the mouseDraged events goes to dragMouseMoved()(from DragSourceMotionListener) and I make the error to use also the “void mouseDragged(MouseEvent e)” from the MouseMotionListener.

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

Sidebar

Related Questions

I want to have a grid type layout of image views. To begin i
i have data-grid in my application and i want to customize my data-grid so
I have a Silverlight 3 application the inside of whose grid layout root looks
I have an image in a grid layout but on comparing the actual image
I have the following page layout in my application: <Grid x:Name=ContentPanel Grid.Row=1> <ScrollViewer x:Name=ScrollViewer1
I have an application, in which I want to displaying a number of image
I made a swing application in which i have a grid layout on a
Aloha everyone, I have a background image with a grid layout and would like
I have a JPanel with a Grid Layout. In the cells of the grid
I have a registration form on my layout grid, made out of a stackPanel.

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.