olywa
asked on
undocumented layout managers
I found HorizBagLayout OrientableFlowLayout VariableGridLayout VerticalBagLayout in classes.zip (1.1.1)
but I cannot find any documentation. Where is the API reference and how are these used?
but I cannot find any documentation. Where is the API reference and how are these used?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have a feeling that these Layout Managers may not be implicitly intended for a programmer's use. I've taken the first two Java programming courses from Sun and there was no documentation for them either.
If I was going to use VariableGridLayout, for instance, I would use it like I use GridLayout. Without looking at the spec, I suspect that I will be allowed to set variable column widths. I don't know if I'll be able to set variable row heights yet... Here goes:
// Create a panel
Panel p = new Panel();
VariableGridLayout vgl = new VariableGridLayout( 1 , 2 , 5 , 5 ) );
p.setLayout( vgl );
// I'd add my components here
Label l = new Label( "Label" );
Button b = new Button( "Button" );
// Say you want to make the button twice as wide as the Label
vgl.setColFraction( 2, .67 );
// the above line says to me, make the second column 2/3 the
// width of the entire grid.
p.add( l );
p.add( b );
add( p );
Try the above and see if it works. I've never used sun.awt as a package before and I'm still not certain if we're supposed to implicitly use it.
Good luck...
If I was going to use VariableGridLayout, for instance, I would use it like I use GridLayout. Without looking at the spec, I suspect that I will be allowed to set variable column widths. I don't know if I'll be able to set variable row heights yet... Here goes:
// Create a panel
Panel p = new Panel();
VariableGridLayout vgl = new VariableGridLayout( 1 , 2 , 5 , 5 ) );
p.setLayout( vgl );
// I'd add my components here
Label l = new Label( "Label" );
Button b = new Button( "Button" );
// Say you want to make the button twice as wide as the Label
vgl.setColFraction( 2, .67 );
// the above line says to me, make the second column 2/3 the
// width of the entire grid.
p.add( l );
p.add( b );
add( p );
Try the above and see if it works. I've never used sun.awt as a package before and I'm still not certain if we're supposed to implicitly use it.
Good luck...
ASKER