Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Window Events

Started by capn_midnight Oct 11, 2004 at 11:19 AM 6 replies 1.5k views
Original Post
capn_midnight
capn_midnight
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.
CoffeeMug
CoffeeMug
Whoops, sorry, I got to this post through the active topics, didn't notice it's a Java forum [smile] Kindly disregard...
garazdawi
garazdawi
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'
capn_midnight
capn_midnight
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.