Results 1 to 9 of 9
  1. #1
    Anel Murselji is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default Drag and Drop object

    I need to do drag and drop on java application for ex; i will put a button or text box or something else and to drag to another place on panel

    Can somebody help about this?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,890
    Rep Power
    25

    Default

    Can you explain in more detail what you want to do? I see two different things you are talking about
    DnD a file from one app to another
    Move a component to a different location in a Java GUI

  3. #3
    Anel Murselji is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default

    yes to move a copy of original component to a different location in a java GUI

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,890
    Rep Power
    25

    Default

    You could use a Mouse Listener. Also you'll need your own layout manager.

  5. #5
    Anel Murselji is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default

    can you show me on an little example how to do it?

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,890
    Rep Power
    25

    Default

    Can you write a small program with a panel with a button on it.
    Add a mouse listener.
    In the listener when the mouse clicks in the button and does a drag, change the location of the button to reflect the motion of the mouse.

  7. #7
    Anel Murselji is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default

    I am new in java and i dont know well how to add a mouse listened and how to drag and change location

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,890
    Rep Power
    25

    Default

    If you are new then you have a lot of learning to do before you try a complicated task.
    This is a good place to start: The Really Big Index

    Search for Mouse Listener and for Drag and drop

  9. #9
    Anel Murselji is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default

    I am not in that manner new i know a little bit about java but not perfect
    Thank you for your help i will read your suggested page

Similar Threads

  1. Need help with drag and drop
    By NixasMuraki in forum New To Java
    Replies: 2
    Last Post: 06-07-2011, 02:55 AM
  2. drag and drop
    By Dean29126 in forum AWT / Swing
    Replies: 0
    Last Post: 01-18-2011, 08:24 AM
  3. drag and drop
    By Dean29126 in forum New To Java
    Replies: 0
    Last Post: 01-18-2011, 08:07 AM
  4. drag and drop - disable intra component drop
    By tomba in forum AWT / Swing
    Replies: 4
    Last Post: 12-09-2009, 02:01 PM
  5. Drag and drop
    By abhivenugopal in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 01-30-2008, 03:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •