dcsimg
Laying out components in AWT applet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Svetoslav_Vasilev
Posted On:   Wednesday, August 22, 2001 06:16 AM

Hi, I experience the following problem.I design a grid control.I want to use a GridBagLayout manager to lay out the cells of the grid within a panel in order to achieve more flexibility in resizing the width and height of the cell.Unfortunately it seems that this layout manager does not work the way it is supposed.I've use this layout manager in several other applets,so I guess i am a bit more familiar with it than usual. What happens is that all the cells for the header of the table are clumped at the middle of their container,dispite I've set the constraints as follows: gbCon.gridWidth = widths[i];//an array where I store the widths of the columns gbCon.fill = GridBagConstraints.BOTH; gbCon.weightx = 1.0; As you can see, i    More>>

Hi,
I experience the following problem.I design a grid control.I want to use a GridBagLayout manager to lay out the cells of the grid within a panel in order to achieve more flexibility in resizing the width and height of the cell.Unfortunately it seems that this layout manager does not work the way it is supposed.I've use this layout manager in several other applets,so I guess i am a bit more familiar with it than usual. What happens is that all the cells for the header of the table are clumped at the middle of their container,dispite I've set the constraints as follows:
gbCon.gridWidth = widths[i];//an array where I store the widths of the columns
gbCon.fill = GridBagConstraints.BOTH;
gbCon.weightx = 1.0;
As you can see, i make this in a loop.
But it does not work at all!It always shows the cells in one and the same way,whatever values i set to the constraints!
The strangest thing is that i should call the corresponding container's method doLayout() each time I add an element to it,otherwise the element is not shown!
Is there something that I miss in dealing with the layout manager,or anything I am wrong?
If there is some resource on developing complex UI components please forward it to me!

   <<Less

Re: Laying out components in AWT applet

Posted By:   Scott_Stanchfield  
Posted On:   Tuesday, August 28, 2001 08:21 AM

About | Sitemap | Contact