@Override
    public Dimension preferredLayoutSize(Container parent) {
      synchronized (parent.getTreeLock()) {
        return parent.getSize();
      }
    }
@Override
    public Dimension preferredLayoutSize(Container parent)