<AWT Dev> OS X fullscreen window and dock
mik3hall at gmail.com
Sun Jan 8 15:04:05 UTC 2017
Stack overflow or someplace like that might be better for this sort of thing, feel free to point that out if so.
But what is the best way to get a fullscreen window, less screen offsets with a hidden dock? While still accounting for the possible dock. I generally like to have my dock hidden but pop up when needed. That space at the bottom of the screen is valuable real estate. However, this can occasionally be a nuisance if I want to actually get to something with the mouse at the very bottom of the screen and it keeps popping up the dock in the way.
I am currently increasing the size of the main window of one of my application’s. Going for as big as I can get it sort of full screen, hopefully less insets for the dock. I can’t seem to get this.
For example using this…
Insets insets = this.getToolkit().getScreenInsets(this.getGraphicsConfiguration());
If I have the dock not visible but appearing automatically I get…
1/8/17 8:25:15.350 AM JavaAppLauncher: Insets java.awt.Insets[top=23,left=0,bottom=4,right=0]
No dock is accounted for at the bottom.
If I change this to always visible I get...
1/8/17 8:51:57.881 AM JavaAppLauncher: Insets java.awt.Insets[top=23,left=0,bottom=43,right=0]
There is the dock.
How can I determine the correct value as below when the user preferences are set to not always visible as in the above?
More information about the awt-dev