Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Problem with mouseDragged(MouseEvent e)

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what i have written in my code:
public void mouseDragged(MouseEvent objMe)
{
TextField txtObject=(TextField)objMe.getSource();
int iNewX = objMe.getX();
int iNewY = objMe.getY();
txtObject.setLocation(iNewX,iNewY);
}
this Code allows me to move the control on the panel which is placed over applet.
But i have two problems
1. The movement is not very clean the TextField has two images and movemnet traces are shown.
2. When i Leave the mouse (Drag-over Or mouse-realse) the control jumps to some other position.
This is not what i intend i want the control to move with the mouse when the move is Dragged and stay where the mouse is Realased.
Plase Help Urgently.
ajay
 
This tiny ad is suggesting that maybe she should go play in traffic.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic