calcCompSize(Component comp, int what) {
private Dimension calcCompSize(Component comp, int what) {
calcCompSize(Component comp, int what){  if (comp == null || !comp.isVisible())    return new Dimension(0, 0);  if (what == MIN)    return comp.getMinimumSize();  else if (what == MAX)    return comp.getMaximumSize();  return comp.getPreferredSize();}