This site requires JavaScript, please enable it in your browser!
Greenfoot back
Wasupmacuz
Wasupmacuz wrote ...

2020/4/11

How might I be able to find the insets of the greenfoot window?

Wasupmacuz Wasupmacuz

2020/4/11

#
I'm trying to make the window fit to any screen resolution (1080/720, 1680/1050, etc). I have it so that it resizes images to scale with your resolution and I made it so that the world's height take into account the height of the taskbar using this:
windowSize = GraphicsEnvironment.getLocalGraphicsEnvironment().
             getMaximumWindowBounds();
But I have no idea how to also account for the height of the system's window header inset. I don't want to manually give it a value because the header could have a different size if the system preferences had a larger font. Any help is appreciated!
Wasupmacuz Wasupmacuz

2020/4/11

#
If anything, I might be able to create a new JFrame or something like that and get the top inset from that and assume it's the correct value as a workaround if I'm unable to find the exact value.
Wasupmacuz Wasupmacuz

2020/4/11

#
Any ideas before I use my workaround?
Wasupmacuz Wasupmacuz

2020/4/11

#
nccb wrote...
In recent versions of Greenfoot, the user code runs in a different process to the main window
I remembered this from a topic last year. Workaround here I come.
You need to login to post a reply.