|
From: Ramon W. <ra...@ja...> - 2003-07-03 21:00:54
|
-------- Francois, I think I see; the constraints are done *before* the widget is defined, analogous to seting the constraints before the add in Java. Now it makes more sense! Thanks. Ramon > Hello Ramon, > > Here's what I would have done instead: > <controls> > <layout class="GridBagLayout"/> > > <constraints> > <gridbag gridx="0" gridy="0" fill="BOTH" anchor="CENTER" > weightx="0.0" weighty="0.0" insets="2"/> > </constraints> > > <label text="Title"/> > <!-- Change only the gridx, as the other entries are correct --> > <constraints><gridbag gridx="1"/></constraints> > <textfield .../> > > <!-- Now, we need to change line, and go back to the left --> > <constraints><gridbag gridx="0" gridy="1"/></constraints> > ... > </controls> > > I suggest you brush up on your GridBagLayout JavaDoc at > http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GridBagLayout.html as > you seem to have confused the meaning of the anchor and fill attribute. > Fill is used to specify how a control should expand in it's grid cell, > and anchor specifies where in a grid cell a control should go, if it does > not fill the whole cell. > > If you have other questions, don't hesitate ! > > Bye ! > Francois > > On Thu, 03 Jul 2003 15:11:34 -0500, "Ramon Williamson" > <ra...@nc...> said: > > Hello. > > > > I am trying out JGB by trying to create a Book Store GUI with Title, > > Author, > > ISBN, and Publisher textfields with labels using the GridBagLayout. I > > have > > written a Java applet that looks like what I want, so I just plugged in > > the > > constraints from that applet into the XML for JGB. Instead of getting: > > > > Title ____________________________ > > Author ____________________________ > > ISBN ______________________________ > > Publisher _________________________ > > > > I get > > > > Title > > ________________________________ Author > > ________________________________ ISBN > > ________________________________ Publisher > > ________________________________ > > > [snip] > -- > Francois Beausoleil > Developer of Java Gui Builder > http://jgb.sourceforge.net/ > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > _______________________________________________ > jgb-general mailing list > jgb...@li... > https://lists.sourceforge.net/lists/listinfo/jgb-general -- --- ############################################################################## Ramon L. Williamson II INTERNET: ra...@nc... Research Programmer Voice: (217) 244-4208 Radio Astronomy Imaging Team National Center for Supercomputing Applications (NCSA) I tried to learn the piano, but I was getting errors with #include<mozart.h>. ***************************************************************************** |