-
swing Null layout
Hi,
I am new to using Swing and I need to create a front-end for a project using
swing. There are many buttons and other controls on the screen at different
locations. I am using the JBuilder 5 IDE for putting the controls on the
screen. I am finding it difficult to place all the controls on the wherever
I want to.I could able to do it by creating too many panles ,setting their
layouts etc...which I feel is a rediuos process..The main problem I find
is using the layout managers, border or flow etc,,,which try to set the controls
on their own without the developer's intervention. alternatively I created
the same layout using JBuilder in 10 mins using the NULL Layout..which is
very good and seems to be quiet simple. But then what is the advantage of
using the tedious layout managers and why is it that we are not supposed
to use the Null layout as told by my friend? I would be happy if anyone could
take time to solve my doubts.
Regards
Satish
-
Re: swing Null layout
Because when the user resizes the frame all your controls are in, the layout
managers automatically rearrange the controls to continue to look good,
whereas the null layout doesn't.
PC2
"satish" <satish_141@yahoo.com> wrote in message
news:3bbd7f4e$1@news.devx.com...
>
>
>
> Hi,
>
>
> I am new to using Swing and I need to create a front-end for a project
using
> swing. There are many buttons and other controls on the screen at
different
> locations. I am using the JBuilder 5 IDE for putting the controls on the
> screen. I am finding it difficult to place all the controls on the
wherever
> I want to.I could able to do it by creating too many panles ,setting their
> layouts etc...which I feel is a rediuos process..The main problem I find
> is using the layout managers, border or flow etc,,,which try to set the
controls
> on their own without the developer's intervention. alternatively I created
> the same layout using JBuilder in 10 mins using the NULL Layout..which is
> very good and seems to be quiet simple. But then what is the advantage of
> using the tedious layout managers and why is it that we are not supposed
> to use the Null layout as told by my friend? I would be happy if anyone
could
> take time to solve my doubts.
>
> Regards
>
> Satish
>
-
Re: swing Null layout
Hi Paul,
Thanks for your response and also for a very good answer. Now I am conviced
that I must use a layout manager, but could you please tell me which layout
manager I should use inorder to create a screen with many controls at different
locations?
Regards
Satish
-
Re: swing Null layout
See my response in java.enterprise
Mark
"satish" <satish_141@yahoo.com> wrote:
>
>Hi Paul,
>
> Thanks for your response and also for a very good answer. Now I am conviced
>that I must use a layout manager, but could you please tell me which layout
>manager I should use inorder to create a screen with many controls at different
>locations?
>
>Regards
>
>Satish
-
Re: swing Null layout
You will probably get the best result if you use GridBagLayout but its not
a very nice thing to work with, look at using boxes they should make it much
easier for you and the nice thing is you can add glues,struts,rigid areas
and spacers to get the appearance you want no matter how the user resizes
your GUI.
Ako
"satish" <satish_141@yahoo.com> wrote:
>
>Hi Paul,
>
> Thanks for your response and also for a very good answer. Now I am conviced
>that I must use a layout manager, but could you please tell me which layout
>manager I should use inorder to create a screen with many controls at different
>locations?
>
>Regards
>
>Satish
-
Re: swing Null layout
You should use a layout manager when your front-end is supposed to be resized
dinamically by the user... the layout manager will fit the new size.
bye
"satish" <satish_141@yahoo.com> wrote:
>
>
>
>Hi,
>
>
> I am new to using Swing and I need to create a front-end for a project
using
>swing. There are many buttons and other controls on the screen at different
>locations. I am using the JBuilder 5 IDE for putting the controls on the
>screen. I am finding it difficult to place all the controls on the wherever
>I want to.I could able to do it by creating too many panles ,setting their
>layouts etc...which I feel is a rediuos process..The main problem I find
>is using the layout managers, border or flow etc,,,which try to set the
controls
>on their own without the developer's intervention. alternatively I created
>the same layout using JBuilder in 10 mins using the NULL Layout..which is
>very good and seems to be quiet simple. But then what is the advantage of
>using the tedious layout managers and why is it that we are not supposed
>to use the Null layout as told by my friend? I would be happy if anyone
could
>take time to solve my doubts.
>
>Regards
>
>Satish
>
-
Re: swing Null layout
According to the help documentation provided with JBuilder:
"Because these layouts[null and XYlayout] are absolute positioning, components
do not adjust well when you resize the parent containers. These layouts
also do not adjust well to differences in users and systems, and therefore,
are not portable layouts."
The specific layout that you should switch to after prototyping within
JBuilder depends on the layout you are trying to achieve. In the samples
directory there are examples of different layouts(mostly null and
FlowLayout) but also includes a project for CardLayout which may interest
you.
"satish" <satish_141@yahoo.com> wrote:
>
>
>
>Hi,
>
>
> I am new to using Swing and I need to create a front-end for a project
using
>swing. There are many buttons and other controls on the screen at different
>locations. I am using the JBuilder 5 IDE for putting the controls on the
>screen. I am finding it difficult to place all the controls on the wherever
>I want to.I could able to do it by creating too many panles ,setting their
>layouts etc...which I feel is a rediuos process..The main problem I find
>is using the layout managers, border or flow etc,,,which try to set the
controls
>on their own without the developer's intervention. alternatively I created
>the same layout using JBuilder in 10 mins using the NULL Layout..which is
>very good and seems to be quiet simple. But then what is the advantage of
>using the tedious layout managers and why is it that we are not supposed
>to use the Null layout as told by my friend? I would be happy if anyone
could
>take time to solve my doubts.
>
>Regards
>
>Satish
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks