Skip to content
Advertisement

Why jframe hides taskbar when maximized?

I’m using setUndecorated(true); and getRootPane().setWindowDecorationStyle(JRootPane.FRAME); in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar?

Also when I maximize minimize my frame multiple times the cursor is changed to this <-> which is generally used change size of frame when cursor is on the border of frame. Is there anything I can do for this?


A small code then can reproduce the thing:

JavaScript

Advertisement

Answer

This is a known bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4737788

Quote from this link:

A workaround is to subclass JFrame and override the setExtendedState method, catching any maximize events before they happen and setting the maximum bounds of the frame appropriately before calling the superclass’s setExtendedState method.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement