posted 18 years ago
hi friends,
i have some problem with JLabel zooming...
i have a JPanel with image as background and i am adding JLabel s dynamically to the JPanel. i have to move the JLabel on the image so i added mouse listener to JLabel. now i want to add zooming functionality to the JJPanel.
now if zoom out JPanel everything works well but JLabel mouse listener location is not changing so if i move mouse over JLabel its not activating listener - i need to move the mouse to original location when its 100% zoom to activate the listener. how can i correct this ?
while i am zooing label also zooming in and out. its only the location of mouse listener.
ex: its positioned at (100,100) while its 100% zoomed , when its zoom out to 50% label and image is zoom out but when i move mouse over label its not firing mouse listener but when i move mouse to (100,100) its firing listener and i am able to move the label. just check my code you guys can understand it.
i know its may be a simple thing i missed.
here is example code,