Skip to main content



      Home
Home » Archived » Visual Editor (VE) » VE & setSize on JPanel class
VE & setSize on JPanel class [message #127697] Wed, 05 July 2006 18:45 Go to next message
Eclipse UserFriend
Originally posted by: laralar.artinsoft.com

Hello,

I have a form generator, that basically generates a java class from a text
representation of the form. Here I generete the following line

this.setSize(GridBagLayoutHelper.computeSize(layout, this, 65, 13));

However, when using the VE, and resizing the form, this get replaced by

this.setSize(new Dimension(477, 273));

As you can see, the row/column representation is being changed to the
pixels on the screen.

My question

How could I start to build a customized version of the VE that instead of
changing row/column representation to the pixel dimension, adds or removes
rows and columns? Where do I have to look for?

thanks,
Luis
Re: VE & setSize on JPanel class [message #127710 is a reply to message #127697] Wed, 05 July 2006 19:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You can't. You changed the size of the form in the ve. It only knows how
to do setSize of a dimension. Since you changed its size it needed to do
a setSize.

However, why are you using setSize at all? You should be using a layout
manager to do all of this. setSize is very fragile and will not handle
different fonts or languages or resizing the entire shell.

Luis Rodriguez wrote:
> Hello,
>
> I have a form generator, that basically generates a java class from a
> text representation of the form. Here I generete the following line
>
> this.setSize(GridBagLayoutHelper.computeSize(layout, this, 65, 13));
>
> However, when using the VE, and resizing the form, this get replaced by
> this.setSize(new Dimension(477, 273));
>
> As you can see, the row/column representation is being changed to the
> pixels on the screen.
>
> My question
>
> How could I start to build a customized version of the VE that instead
> of changing row/column representation to the pixel dimension, adds or
> removes rows and columns? Where do I have to look for?
>
> thanks,
> Luis
>

--
Thanks,
Rich Kulp
Re: VE & setSize on JPanel class [message #127966 is a reply to message #127710] Fri, 07 July 2006 19:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jamesrome.gmail.com

Rich Kulp wrote, On 7/5/2006 7:27 PM:
> You can't. You changed the size of the form in the ve. It only knows how
> to do setSize of a dimension. Since you changed its size it needed to do
> a setSize.
>
> However, why are you using setSize at all? You should be using a layout
> manager to do all of this. setSize is very fragile and will not handle
> different fonts or languages or resizing the entire shell.
>
When I put a JPanel into the VE in, say the South of the default Border Layout
Manager, it has zero size, and I cannot put other components into it until I set
its size. Am I doing something wrong here?

Jim
Re: VE & setSize on JPanel class [message #128148 is a reply to message #127966] Mon, 10 July 2006 10:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

No you are not doing anything wrong, the problem is there is nothing in
your JPanel, so its preferred height is 0 when there is nothing in it.
You put it in the South location, in that location the BorderLayout will
make the width of the control as wide as the parent panel and only as
tall as the preferred height of the panel.

Until you set some controls into it (which you can do by dropping on the
Java Beans Viewer) the panel will not have height.

Jim Rome wrote:
> Rich Kulp wrote, On 7/5/2006 7:27 PM:
>
>>You can't. You changed the size of the form in the ve. It only knows how
>>to do setSize of a dimension. Since you changed its size it needed to do
>>a setSize.
>>
>>However, why are you using setSize at all? You should be using a layout
>>manager to do all of this. setSize is very fragile and will not handle
>>different fonts or languages or resizing the entire shell.
>>
>
> When I put a JPanel into the VE in, say the South of the default Border Layout
> Manager, it has zero size, and I cannot put other components into it until I set
> its size. Am I doing something wrong here?
>
> Jim

--
Thanks,
Rich Kulp
Re: VE & setSize on JPanel class [message #128200 is a reply to message #128148] Mon, 10 July 2006 10:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jamesrome.gmail.com

Rich Kulp wrote, On 7/10/2006 10:25 AM:
> No you are not doing anything wrong, the problem is there is nothing in
> your JPanel, so its preferred height is 0 when there is nothing in it.
> You put it in the South location, in that location the BorderLayout will
> make the width of the control as wide as the parent panel and only as
> tall as the preferred height of the panel.
>
> Until you set some controls into it (which you can do by dropping on the
> Java Beans Viewer) the panel will not have height.
> It seems to me that I should be able to drop things onto the panel in the VE
itself. That is the way it is done in other GUIs such as Sun Studio Creator.
Re: VE & setSize on JPanel class [message #128210 is a reply to message #128148] Mon, 10 July 2006 10:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jamesrome.gmail.com

Rich Kulp wrote, On 7/10/2006 10:25 AM:

> Until you set some controls into it (which you can do by dropping on the
> Java Beans Viewer) the panel will not have height.
>
And I just went back into my project and reset the preferred size to 0,0, and it
shrunk to a horizontal line, even though it contained components. It would not
accept a blank for the preferred size. So I am confused.

Jim
Re: VE & setSize on JPanel class [message #128222 is a reply to message #128200] Mon, 10 July 2006 11:03 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The VE is showing you exactly what you would see in the real app. Since
it would be 0 height in the real app it is zero height in the VE.

You can drop controls on the Java Beans Viewer. That will put them in
the panel, and now panel will have a height.

Jim Rome wrote:
> Rich Kulp wrote, On 7/10/2006 10:25 AM:
>
>>No you are not doing anything wrong, the problem is there is nothing in
>>your JPanel, so its preferred height is 0 when there is nothing in it.
>>You put it in the South location, in that location the BorderLayout will
>>make the width of the control as wide as the parent panel and only as
>>tall as the preferred height of the panel.
>>
>>Until you set some controls into it (which you can do by dropping on the
>>Java Beans Viewer) the panel will not have height.
>>It seems to me that I should be able to drop things onto the panel in the VE
>
> itself. That is the way it is done in other GUIs such as Sun Studio Creator.

--
Thanks,
Rich Kulp
Re: VE & setSize on JPanel class [message #613459 is a reply to message #127697] Wed, 05 July 2006 19:27 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You can't. You changed the size of the form in the ve. It only knows how
to do setSize of a dimension. Since you changed its size it needed to do
a setSize.

However, why are you using setSize at all? You should be using a layout
manager to do all of this. setSize is very fragile and will not handle
different fonts or languages or resizing the entire shell.

Luis Rodriguez wrote:
> Hello,
>
> I have a form generator, that basically generates a java class from a
> text representation of the form. Here I generete the following line
>
> this.setSize(GridBagLayoutHelper.computeSize(layout, this, 65, 13));
>
> However, when using the VE, and resizing the form, this get replaced by
> this.setSize(new Dimension(477, 273));
>
> As you can see, the row/column representation is being changed to the
> pixels on the screen.
>
> My question
>
> How could I start to build a customized version of the VE that instead
> of changing row/column representation to the pixel dimension, adds or
> removes rows and columns? Where do I have to look for?
>
> thanks,
> Luis
>

--
Thanks,
Rich Kulp
Re: VE & setSize on JPanel class [message #613479 is a reply to message #127710] Fri, 07 July 2006 19:12 Go to previous message
Eclipse UserFriend
Originally posted by: jamesrome.gmail.com

Rich Kulp wrote, On 7/5/2006 7:27 PM:
> You can't. You changed the size of the form in the ve. It only knows how
> to do setSize of a dimension. Since you changed its size it needed to do
> a setSize.
>
> However, why are you using setSize at all? You should be using a layout
> manager to do all of this. setSize is very fragile and will not handle
> different fonts or languages or resizing the entire shell.
>
When I put a JPanel into the VE in, say the South of the default Border Layout
Manager, it has zero size, and I cannot put other components into it until I set
its size. Am I doing something wrong here?

Jim
Re: VE & setSize on JPanel class [message #613493 is a reply to message #127966] Mon, 10 July 2006 10:25 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

No you are not doing anything wrong, the problem is there is nothing in
your JPanel, so its preferred height is 0 when there is nothing in it.
You put it in the South location, in that location the BorderLayout will
make the width of the control as wide as the parent panel and only as
tall as the preferred height of the panel.

Until you set some controls into it (which you can do by dropping on the
Java Beans Viewer) the panel will not have height.

Jim Rome wrote:
> Rich Kulp wrote, On 7/5/2006 7:27 PM:
>
>>You can't. You changed the size of the form in the ve. It only knows how
>>to do setSize of a dimension. Since you changed its size it needed to do
>>a setSize.
>>
>>However, why are you using setSize at all? You should be using a layout
>>manager to do all of this. setSize is very fragile and will not handle
>>different fonts or languages or resizing the entire shell.
>>
>
> When I put a JPanel into the VE in, say the South of the default Border Layout
> Manager, it has zero size, and I cannot put other components into it until I set
> its size. Am I doing something wrong here?
>
> Jim

--
Thanks,
Rich Kulp
Re: VE & setSize on JPanel class [message #613497 is a reply to message #128148] Mon, 10 July 2006 10:52 Go to previous message
Eclipse UserFriend
Originally posted by: jamesrome.gmail.com

Rich Kulp wrote, On 7/10/2006 10:25 AM:
> No you are not doing anything wrong, the problem is there is nothing in
> your JPanel, so its preferred height is 0 when there is nothing in it.
> You put it in the South location, in that location the BorderLayout will
> make the width of the control as wide as the parent panel and only as
> tall as the preferred height of the panel.
>
> Until you set some controls into it (which you can do by dropping on the
> Java Beans Viewer) the panel will not have height.
> It seems to me that I should be able to drop things onto the panel in the VE
itself. That is the way it is done in other GUIs such as Sun Studio Creator.
Re: VE & setSize on JPanel class [message #613498 is a reply to message #128148] Mon, 10 July 2006 10:55 Go to previous message
Eclipse UserFriend
Originally posted by: jamesrome.gmail.com

Rich Kulp wrote, On 7/10/2006 10:25 AM:

> Until you set some controls into it (which you can do by dropping on the
> Java Beans Viewer) the panel will not have height.
>
And I just went back into my project and reset the preferred size to 0,0, and it
shrunk to a horizontal line, even though it contained components. It would not
accept a blank for the preferred size. So I am confused.

Jim
Re: VE & setSize on JPanel class [message #613499 is a reply to message #128200] Mon, 10 July 2006 11:03 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The VE is showing you exactly what you would see in the real app. Since
it would be 0 height in the real app it is zero height in the VE.

You can drop controls on the Java Beans Viewer. That will put them in
the panel, and now panel will have a height.

Jim Rome wrote:
> Rich Kulp wrote, On 7/10/2006 10:25 AM:
>
>>No you are not doing anything wrong, the problem is there is nothing in
>>your JPanel, so its preferred height is 0 when there is nothing in it.
>>You put it in the South location, in that location the BorderLayout will
>>make the width of the control as wide as the parent panel and only as
>>tall as the preferred height of the panel.
>>
>>Until you set some controls into it (which you can do by dropping on the
>>Java Beans Viewer) the panel will not have height.
>>It seems to me that I should be able to drop things onto the panel in the VE
>
> itself. That is the way it is done in other GUIs such as Sun Studio Creator.

--
Thanks,
Rich Kulp
Previous Topic:Does the ve support custom data type?
Next Topic:VE 1.3?
Goto Forum:
  


Current Time: Thu Jun 19 22:42:41 EDT 2025

Powered by FUDForum. Page generated in 0.08835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top