* PM:5/8/07 moved this code to a new method
* @param newSize
*/
private void resizeJFrame(final Dimension newSize){
Insets insets = this.frame.getInsets();
JLayeredPane layeredPane = this.frame.getLayeredPane();
Insets layeredPaneInsets = new Insets(0,0,0,0);
JMenuBar menuBar = this.frame.getJMenuBar();
int menuHeight = (menuBar == null) ? 0 : menuBar.getHeight(); // Compensate for only the height of the menu, the width is derived from the screen.
Component glassPane = this.frame.getGlassPane();
JRootPane rootPane = this.frame.getRootPane();
Insets RootPaneInsets = new Insets(0,0,0,0);
// Layered pane = content pane + menu bar + insets
if (layeredPane != null) {
layeredPane.getInsets(layeredPaneInsets);
// TF:20/8/07:Tests show that if we include the menu height here that our window comes out too big,
// by the height of the menu. So setting the layered pane size must cater for this.
newSize.height += menuHeight + layeredPaneInsets.top + layeredPaneInsets.bottom;
newSize.width += layeredPaneInsets.left + layeredPaneInsets.right;
if (_log.isDebugEnabled()) {
_log.debug("\tsetting layered pane size to " + newSize);
}
if (newSize.height != layeredPane.getHeight()
|| newSize.width != layeredPane.getWidth()) {
layeredPane.setSize(newSize);
layeredPane.revalidate();
layeredPane.repaint();
}
}
// size the glass pane
if (glassPane != null) {
if (_log.isDebugEnabled()) {