-
Bug
-
Resolution: Fixed
-
P4
-
1.1.6
-
tiger
-
x86
-
windows_nt
Name: bk70084 Date: 06/25/98
The first time a scrollpane is added/becomes
visible with SCROLLBARS_AS_NEEDED, it always uses
both vertical and horizontal scrollbars.
The following example creates a frame without a
size. To demonstrate the bug, resize the frame
so that the component gets laid out for the first
time. Both scrollbars will appear. Another
resize (larger or smaller) will exhibit proper
behavior. If you resize to the smallest allowable,
and then expand the frame again, the bug will
repeat. The example demonstrates a problem I have
in a much more complex application.
Within my application, I have tried both
doLayout() and validate() on the ScrollPane,
it's Container, the top level Frame, to no avail.
Code follows:
-------------
import java.awt.ScrollPane;
import java.awt.Button;
import java.awt.Frame;
class ScrollPaneTest
{
public static void main( String[] args )
{
Frame f = new Frame();
ScrollPane sp = new ScrollPane( ScrollPane.SCROLLBARS_AS_NEEDED );
sp.add( new Button( "TEST" ) );
f.add( "Center", sp );
f.show();
}
}
(Review ID: 34226)
======================================================================