• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with mouseDragged(MouseEvent e)

 
ajay chaturvedi
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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!