I am developing an application that drag and scale image in Jpanel.
The image is stored inside a JLabel.
But when i am adding the MouseMotionListener to the panel, then whole window is dragging and when i am trying to add MouseMotionListener to I can't select the sides of image to scale it.
So can i directly add MouseMotionListener to BufferedImage?
With any component I add MouseMotionListener, it don't allow me to select sides of image. sides means all direction for to scale image.
Window :
addMouseListener(handler);
addMouseMotionListener(handler);
JLabel :
label.addMouseListener(new MouseHandler());
label.addMouseMotionListener(new MouseHandler());
Here MouseHandler
is a class defined for various operation like mousePressed
, mouseDragged
, mouseMove
, etc.
Any idea why it is behaving like that?