Hello, Can anybody please tell me what interface to implement and what method to override in order to execute codes while a JFrame is being resized by dragging its border with mouse?
Thanks Barry, for your swing business, I shall remember to post at the right place.
Also thanks to Michael but that does not solve my problem. There is a method called componentResized(), but that is called after a component has been resized. I was asking for a method while I am resizing a component and not after resize.
haven't heard of an event 'while resizing', but not too hard to simulate
JFrame.setDefaultLookAndFeelDecorated(true); construct a JFrame add a MouseMotionListener to the frame in mouseDragged() compare frame's width/height to previous numbers if(width or height <> old numbers) its being resized else its just being moved
Thanks again Michael. But this time also it didn't work. As it turns out, when you are resizing a frame by holding and dragging one of it's borders using mouse, the mouseDragged() method is not getting called, only it is called when you are actually dragging the mouse on the body of the frame as the following code suggests:
[ September 03, 2006: Message edited by: Prosenjit Banerjee ]
Sorry Michael, I missed that. But, thank you very much, I learnt a new thing. It works! I am happy but dissppointed at the same time. Because I could not do it with the default look and feel. Only in order to provide the very common resizing event I had to change the total look and feel of a frame! Frankly, that is not really desired.
Again, I wonder how things like this can be known (e.g. that a decorated laf supports risize event)? Is there any such documentation? [ September 04, 2006: Message edited by: Prosenjit Banerjee ]