Re: GridBagLayout and changing constraints objects.
- From: "Daniel Pitts" <googlegroupie@xxxxxxxxxxxxx>
- Date: 25 Mar 2007 18:46:48 -0700
On Mar 25, 5:14 pm, "SadRed" <cardinal_r...@xxxxxxxxxxx> wrote:
On Mar 26, 7:07 am, "Daniel Pitts" <googlegrou...@xxxxxxxxxxxxx>
wrote:
Say I have the following code:
JPanel myPanel = new JPanel(new GridBagLayout());
GridBagConstraints constaints = getConstraints();
myPanel.add(new JLabel("Hello world"), constaints);
And then later (as a result of an Event), I do something like
constraints.gridx = 3;
myPanel.revalidate();
Will this have the expected effect, or do I need to remove the old
label, and re-add it with the new constraints?
You could try it yourself.
I could, but that might have only proved that sometimes it works. I
was asking if it would always work... As I discovered, it won't ever
work, but there is a different way to do it that will always work.
.
- References:
- Re: GridBagLayout and changing constraints objects.
- From: SadRed
- Re: GridBagLayout and changing constraints objects.
- Prev by Date: Re: GridBagLayout and changing constraints objects.
- Next by Date: Re: GridBagLayout and changing constraints objects.
- Previous by thread: Re: GridBagLayout and changing constraints objects.
- Next by thread: Re: GridBagLayout and changing constraints objects.
- Index(es):
Relevant Pages
|
|