I have created a JLabel lab1. Added it to a panel and added mousemotionlistener to the label
lab1.addMouseMotionListener(new InfoListener());
Here is the mouseDragged code
public void mouseDragged(MouseEvent me){
lab1=(JLabel)me.getSource();
lab1.setLocation(me.getPoint());
}
When i click and drag the label the position alternates between the moved point and home position of the panel and does not exactly move to where i want it to. The panel is in null layout and i have also mentioned setBounds for it initially.
What about this?