Re: GridBagLayout and changing constraints objects.
- From: Knute Johnson <nospam@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 25 Mar 2007 15:39:02 -0700
Daniel Pitts wrote:
Say I have the following code:
JPanel myPanel = new JPanel(new GridBagLayout());
GridBagConstraints constaints = getConstraints();
What class does the method getConstraints() belong to?
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?
No. You will have to re-add it.
--
Knute Johnson
email s/nospam/knute/
.
- 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
|