Check out the following code first:

<form>
   <hbox spacing="30">
       <hbox spacing="5">
           <text>First Name:</text>
           <edittext></edittext>
       </hbox>
       <hbox spacing="5">
           <text>Last Name:</text>
           <edittext></edittext>
       </hbox>
   </hbox>
   <hbox spacing="30">
       <hbox spacing="5">
           <text>Age:</text>
           <edittext></edittext>
       </hbox>
       <hbox spacing="5">
           <text>Email:</text>
           <edittext></edittext>
       </hbox>
   </hbox>
</form>

As you can see, the layout is not very good, because the <text/> component's
width is not the same, so the whole form's align is very ugly. Of course, I
can find out the longest widget and set all widgets' width to it. But if I
change the fontsize or fontstyle, or even change the <text/> content itself.
I have to recompute the layout again. Is there an easy way to implement
something like a Swing-GridLayout?

Another problem about the above code is that it uses many <hbox/>s, I don't
know if this will slow down the loading or rendering speed of the
application, but I really think it will. Is there a way to increase the
performance?

Thanks a lot.


Allen

Reply via email to