Jump to content
  • Advertisement
Sign in to follow this  
capn_midnight

[java] Window Events

This topic is 5396 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
heh, this is the Java forum, WM_SIZE wParam is Windows-specific C/C++

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!