How can I detect the space used by the warning bar of a window created by an untrusted applet?

John Zukowski

The getInsets() method reports the space used by the window's decorations like the title bar and any message bar. The value isn't valid until the applet is realized/displayed.