I don't believe there are events for "about to resize" so what I would do is store your deminsions when your application first loads. Afterwhich you can capture resize events and store them accordingly.
If I want to store the dimensions when the java Frame first loads. I should call getHeight, getWidth from the constructor right? But the value I gotten is 0. Is there anyway I can get the initial value?
Originally posted by Michael Dunn: call your getWidth() getHeight() after setting the frame's visibility to true
I was going to suggest that but wanted to do a bit more research on when the size actually gets set. It seems odd to me that setting the frame visible is when that happens. To me it makes more sense for it to be when a) pack() is called or b) setSize(x,y) is called. I'd assume, though I haven't tested, that setVisible(false) will then return 0,0 for w and h. Again, seems odd as the frame is not disposed of, merely invisible. I guess if you think of it in terms of the frame being "turned off" then it makes more sense. But still odd.
Ok, I am rambling and it doesn't really matter. Michael is right, of course.