This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic