move object

Hi,
I am a beginner in a java. Could you help me? I don't know how to make object move.
I have a small rectange. And It has to move there where is a cursor.
I think I have to make:
public void mouseMoved(mouseEvent e)
{
Point souradnice = e.getPoint();
}