Results 1 to 3 of 3

Thread: Dragging JLabel

  1. #1
    techbossmb is offline Member
    Join Date
    Sep 2009
    Rep Power

    Default Dragging JLabel

    I am having a problem with dragging a jLabel on a JPanel. I used the method mousedragged<code>public void MouseDragged(MouseEvent e){jLabel.setLocation(e.getX(),e.getY());}</code>that's all i used but i what i saw was that when i drag the label, i see double label moving. I decided to add the code<code>Thread.currentThread(100)</code> , then i got just a label put the dragging is not yet okay. Some one said i could use a timer to take care of it but i don't know how. Please help me out.

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Rep Power


    Well, I can't enter a link but you can search the web for my "tips4java" website and then search for the "Moving Windows" entry which can also be used to move components.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Dragging Boxes
    By anilanar in forum New To Java
    Replies: 8
    Last Post: 09-05-2009, 09:23 PM
  2. Replies: 3
    Last Post: 08-20-2009, 02:04 AM
  3. Replies: 0
    Last Post: 04-05-2009, 01:22 PM
  4. Limiting the Dragging area
    By Preethi in forum New To Java
    Replies: 1
    Last Post: 07-30-2008, 03:51 PM
  5. Scaling-ache and mouse dragging
    By willemjav in forum Java Applets
    Replies: 19
    Last Post: 07-19-2008, 12:17 AM

Posting Permissions

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