This content has been marked as final. Show 3 replies
You need to break your algorithm up.
1) First listen for the mouse down event. Using the (x,y) values of the pointer provided in the event passed to your listener.
2) Determine whether or not that mouse pointer falls along a specific box-region in your panel. You know the panel's (x,y) coordinate and its width and height, so just calculate a box-region at the bottom right of the panel. If the pointer falls in that region, set a member variable flag to indicate that resizing is enabled. Also, record the (x,y) value of the pointer at this moment in another member variable.
3) Add another listener for the mouse move event. If the resizing flag is set, then resize the window based on the difference between the new mouse cursor position and the one you recorded down in step 1.
since i am a beginner so do u have any code sample to do what you told?
never mind I put some extra efforts and was able to achieve so...