frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height);
    public void layoutContainer(Container c)    {      Dimension dims = frame.getSize();      Insets insets = frame.getInsets();      dims.width -= insets.left + insets.right;      dims.height -= insets.top + insets.bottom;      frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width,                                                   dims.height);      int nh = 0;      int sh = 0;      int ew = 0;      int ww = 0;      if (northPane != null)        {          Dimension nDims = northPane.getPreferredSize();          nh = Math.min(nDims.height, dims.height);          northPane.setBounds(insets.left, insets.top, dims.width, nh);        }      if (southPane != null)        {          Dimension sDims = southPane.getPreferredSize();          sh = Math.min(sDims.height, dims.height - nh);          southPane.setBounds(insets.left, insets.top + dims.height - sh,                              dims.width, sh);        }      int remHeight = dims.height - sh - nh;      if (westPane != null)        {          Dimension wDims = westPane.getPreferredSize();          ww = Math.min(dims.width, wDims.width);          westPane.setBounds(insets.left, insets.top + nh, ww, remHeight);        }      if (eastPane != null)        {          Dimension eDims = eastPane.getPreferredSize();          ew = Math.min(eDims.width, dims.width - ww);          eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh,                             ew, remHeight);        }      int remWidth = dims.width - ww - ew;      frame.getRootPane().setBounds(insets.left + ww, insets.top + nh,                                    remWidth, remHeight);    }