|
![]() |
Mark E Hansen wrote:Fair enough. I realize that the whole issue of the second content panel changing size is not part of the issue, so I've done away with that. This program has three inner content panels. In it's present state, the third panel (the Blue one) floats about midway in the available vertical space, while I want it to sit right up under the second content panel.
As I said, if I set the weighty value really high when adding the third content panel, it sits up where I want it, but this just doesn't seem like the right solution.
luck, db
There are no new questions, but there may be new answers.
Rob Camick wrote:What confuses me now with the original example is how the weightY is working. I thought weightY was used to increase the height of the panel. So why do we see a "gap" between the second and third panel. I would expect the the height of the second panel should be increased so the "gap" should actually be painted CYAN since that panel has increased in height. Similiarly the "gap" after the third panel should be painted BLUE since it represents the increased height of the third panel.
Am I missing something else about how this layout manager works?
Rob Camick wrote:Think I got it. The trick is to set the weightY only on the last component added, so I borrowed from the BoxLayout to add a dummy component at the end. Of course you could add the weightY to the last real component, but this assumes you know exactly how many components you want to add. I'm assuming you have a dynamic panel where you can add a random number of components.
as the inner panels are actually pre-existing components which need to continue to work in other places in the application, and I'm worried about changing them too much. Of course, I could just place those component inside my own panels and set the size on those...
Rob Camick wrote:
as the inner panels are actually pre-existing components which need to continue to work in other places in the application, and I'm worried about changing them too much. Of course, I could just place those component inside my own panels and set the size on those...
Components can only be added to a single parent container.
It could be due to his setting the GridBagConstraints fill property to horizontal and not both.
The application has a FooWidgetPanel which is used in several places.
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
|