Dimension d= new Dimension(width,height); setMinimumSize(d); setPreferredSize(d); panel.setDividerLocation(height); lastHeight = height;
Dimension d= new Dimension(width,height); setPreferredSize(d); setMaximumSize(d); panel.setToPreferredSizes();
	public void doLayout() {			if (reentrant == true)			return;		reentrant = true;			double x=0;		double y =VSEP;		ProjectLabel pl;		int width = getWidth();		System.err.println("displaying project list. width of window is "+width);		System.err.println("height is "+getHeight());		Rectangle bounds = getBounds();				Vector rows = new Vector();		Vector row = new Vector();		Vector widths = new Vector();		PBounds b;		double rowWidth;				Iterator iter = layer.getChildrenIterator();				while (iter.hasNext()) {			Object obj = iter.next();			if (obj instanceof ProjectLabel) {				pl = (ProjectLabel) obj;							double labelWidth = pl.getScaledMaxWidth();				if (x+labelWidth > width) {					rows.add(row);					widths.add(new Double(x));					x =0;					row = new Vector();				}				row.add(pl);				x += labelWidth;			}		}		rows.add(row);		widths.add(new Double(x));		double rowHeight  = 0;		double spacing = 0;		Iterator iter2;		for (int i = 0; i < rows.size(); i++) {			row = (Vector) rows.elementAt(i);			Double rowW = (Double) widths.elementAt(i);			rowWidth = 	rowW.doubleValue();			iter = row.iterator();			//  calculate space between items.			// leftover is width - rowWidth			double remainder = width-rowWidth;			// divide that by n-1 			if (row.size() >1)				spacing = remainder/(row.size()+1);			else 				spacing = 0;			x = 0;			rowHeight = 0;			while (iter.hasNext()) {				pl = (ProjectLabel) iter.next();				// place this				pl.setOffset(x,y);				b = pl.getGlobalFullBounds();				x += pl.getScaledMaxWidth()+spacing;				if (pl.getScaledMaxHeight() > rowHeight) 					rowHeight= pl.getScaledMaxHeight();			}			y+= rowHeight;		}				int height  = (int) (y+VSEP);		//if (height > lastHeight) {			Dimension d= new Dimension(width,height);			setMinimumSize(d);			setPreferredSize(d);			panel.setDividerLocation(height);			lastHeight = height;		//}		reentrant = false;	}