Index: javax/swing/text/BoxView.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/text/BoxView.java,v retrieving revision 1.11 diff -u -r1.11 BoxView.java --- javax/swing/text/BoxView.java 17 Nov 2005 20:45:13 -0000 1.11 +++ javax/swing/text/BoxView.java 17 Nov 2005 20:55:10 -0000 @@ -740,4 +740,22 @@ yLayoutValid = false; super.preferenceChanged(child, width, height); } + + /** + * Maps the document model position pos to a Shape + * in the view coordinate space. This method overrides CompositeView's + * method to make sure the children are allocated properly before + * calling the super's behaviour. + */ + public Shape modelToView(int pos, Shape a, Position.Bias bias) + throws BadLocationException + { + // Make sure everything is allocated properly and then call super + if (!isAllocationValid()) + { + Rectangle bounds = a.getBounds(); + setSize(bounds.width, bounds.height); + } + return super.modelToView(pos, a, bias); + } }