Reputation: 1
After I do a resizing at a JFrame, is there any method that returns the difference between the old and new size, i.e (dx,dy) ?
If not, is there a way to get this info?
Upvotes: 0
Views: 88
Reputation: 347314
You need to know what the size was before the frame was resized, then you could use a ComponentListener
to detect when the frame's size was changed. The trick here is knowning when the "size" has changed to a fixed point from which taking a measure is worthwhile. Once the frame has "settled" you would simply need to calculate the difference from the "last resize" to now
Start by having a look at How to Write a Component Listener
Conceptually, you want to do something like this or something like this
Upvotes: 1