[jaxx-interest] new blog entry: "Reinventing GridBagLayout"
Anderson, Kelly
KAnderson at dentrix.com
Thu Apr 20 17:15:37 EDT 2006
>From your blog on Table...
<Table>
<row>
<cell><JLabel text='Username:'/></cell>
<cell><JTextField id='username'/></cell>
</row>
<row>
<cell><JLabel text='Password:'/></cell>
<cell><JPasswordField id='password'/></cell>
</row>
<row>
<cell columns='2'>
<JPanel layout='{new GridLayout(1, 2, 6, 6)}'>
<JButton text='OK'/>
<JButton text='Cancel'/>
</JPanel>
</cell>
</row>
</Table>
I don't know much about your Table XML, or GridBagLayout for that matter
but I wonder why you wouldn't just do something like this to layout that
dialog:
<Table>
<column layout='Center'>
<row layout='Center'> // meaning centered up and down.
<JLabel text='Username:'/>
<JTextField id='username'/>
</row>
<row layout='Center'>
<JLabel text='Password:'/>
<JPasswordField id='password'/>
</row>
<row layout='Center'>
<JButton text='OK'/>
<JButton text='Cancel'/>
</row>
</column>
</Table>
Isn't that conceptually simpler? This uses the boxes and glue method
Donald Knuth pioneered in TeX for layout of mathematical formulas. I've
used it for dialog layout before, and it works very well (especially
once you add a 2D grid). I'm not certain of the reason for the <cell>
tag, but you could add it back in to such a scheme if you need it.
It also seems just to be good luck that the text boxes ended up being
the same width, how does that work?
-Kelly
> -----Original Message-----
> From: jaxx-interest-bounces at jaxxframework.org
> [mailto:jaxx-interest-bounces at jaxxframework.org] On Behalf Of
> Ethan Nicholas
> Sent: Thursday, April 20, 2006 2:24 PM
> To: jaxx-interest at jaxxframework.org
> Subject: [jaxx-interest] new blog entry: "Reinventing GridBagLayout"
>
> Hi all,
>
> I've just posted a new blog entry which you may be interested
> in -- it's about JAXX's <Table> tag. Take a look at
> http://weblogs.java.net/blog/enicholas/archive/2006/04/reinven
> ting_gri.html
>
> Also there's a post in the forum which details the steps JAXX
> is going through to reach a 1.0 release:
> http://www.jaxxframework.org/forum/viewtopic.php?t=36
>
> Ethan
>
> _______________________________________________
> jaxx-interest mailing list
> jaxx-interest at jaxxframework.org
> http://jaxxframework.org/mailman/listinfo/jaxx-interest_jaxxfr
> amework.org
>
>
E-Mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Sender is not liable for any loss or damage arising from this message.
The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized.
More information about the jaxx-interest
mailing list