Look & Feel Decorated frames and maximizing.

Does anyone know why when you do L&F decorated JFrames, it breaks the frame maximizing? I've been reading all morning and don't see anything that really explains what's going on with this.

I have a L&F decorated JFrame and I have done some work on my own L&F with some special titlebar handling and whatnot. That's all working perfectly. But when I maximize the frames, it covers the windows taskbar.

My only solution right now is to subclass JFrame and when the extended state is updated to maximize, I reset the maxmized bounds of the frame with info from toolkit and graphics environment to account for the taskbar. This also works fine for the most part.

But the problem with this is that if the taskbar is in auto-hide mode, I have no way to know (that I can find) when it's shown/hidden to force the window to adjust it's size to account for the taskbar size. Except, of course, to constantly check the available window bounds in a thread, which is not very elegant.

[1017 byte] By [bsampieria] at [2007-10-3 11:59:54]
# 1

this will indicate whether the task bar is hidden/shown when the app starts

(provided the taskbar is at the bottom - you may have to look at all sides for > 0)

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

GraphicsDevice[] devices = ge.getScreenDevices();

System.out.println(Toolkit.getDefaultToolkit().getScreenInsets(devices[0].getDefaultConfiguration()).bottom);

Michael_Dunna at 2007-7-15 14:36:10 > top of Java-index,Desktop,Core GUI APIs...
# 2

Thanks, but I know about that. The problem is if the window is maximized, I have no way to know that the taskbar has moved or changed size. This is automatically adjusted for when using system-decorated frames. It doesn't make much sense that L&F decorated frames can't behave the same way, by simply having the underlying frame change bounds automatically.

bsampieria at 2007-7-15 14:36:10 > top of Java-index,Desktop,Core GUI APIs...