Insets frameInsets = frame.getInsets();    int height = 0; int width = 0; Dimension d;  Component[] components = BasicInternalFrameTitlePane.this.getComponents(); for (int i = 0; i < components.length; i++) { d = components[i].getPreferredSize(); height = Math.max(height, d.height); width += d.width; }  Insets insets = BasicInternalFrameTitlePane.this.getInsets(); height += insets.top + insets.bottom;  return new Dimension(width, height);
return new Dimension(22, 18);
    public Dimension preferredLayoutSize(Container c)    {      Insets frameInsets = frame.getInsets();      // Height is the max of the preferredHeights of all components      // inside the pane      int height = 0;      int width = 0;      Dimension d;      Component[] components = BasicInternalFrameTitlePane.this.getComponents();      for (int i = 0; i < components.length; i++)        {	  d = components[i].getPreferredSize();	  height = Math.max(height, d.height);	  width += d.width;        }      Insets insets = BasicInternalFrameTitlePane.this.getInsets();      height += insets.top + insets.bottom;      return new Dimension(width, height);    }