[java] Window Events

Started by
6 comments, last by capn_midnight 19 years, 6 months ago
I'm looking through all of the window events, but I don't see one for maximizing a window. There is minimizing (iconify), restoring (deiconify), but nothing to check if it's been set to full screen resolution.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Advertisement
WM_SIZE. The wParam will tell you if the window is minimized, maximized, restored, etc.
heh, this is the Java forum, WM_SIZE wParam is Windows-specific C/C++
Sorry, the AP above was me, forgot to login
Maybe you could just listen for resizes

[Edited by - Roboguy on October 11, 2004 12:41:33 PM]
Whoops, sorry, I got to this post through the active topics, didn't notice it's a Java forum [smile] Kindly disregard...
Well one way to do it would be to check which resolution your screen is currently in and then set the size of the window to it. This is not close to perfect though... but it's all I can think of without looking at the API...

EDIT: just had a loop around and I found Frame.getMaximizedBounds(), which later can be used to set the bound of the frame to it's maximized position...
garazdawi - 'I put the laughter back in slaughter'
well, I figured it out. You implement a window state listener, and when the window state changes, you check the extended state for the frame. You can then AND that with any number of mask values to get what you want.

if((frame.getExtendedState()&JFrame.MAXIMIZED_BOTH)!=0) //it's maximized

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

This topic is closed to new replies.

Advertisement