|
From: Ramon W. <ra...@nc...> - 2003-07-03 20:11:43
|
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
________________________________
I have pounded and pounded this, and still get same results.
Any help would be appreciated.
Here is the XML:
<!DOCTYPE window PUBLIC
"-//SOURCEFORGE/Java Gui Builder DTD version 1.0//EN"
"http://jgb.sourceforge.net/dtd/jgb.dtd">
<window id="BookStore" type="jframe">
<object id="window.size" class="java.awt.Dimension">
<constructor>
<parameter name="width">
<value type="int" data="480"/>
</parameter>
<parameter name="height">
<value type="int" data="400"/>
</parameter>
</constructor>
</object>
<controls>
<layout class="GridBagLayout"/>
<constraints>
<gridbag fill="BOTH" anchor="NORTH" gridwidth="1"
gridheight="1"
gridx="0" gridy="0" insets="2" weightx="0.0"
weighty="0.0"/>
</constraints>
<label id="labelTitle" text="Title"/>
<constraints>
<gridbag gridx="0" gridy="1" gridwidth="1"
gridheight="1" weightx="10.0" weighty="40.0" fill="NONE"/>
</constraints>
<textfield id="tfTitle" columns="40" />
<constraints>
<gridbag gridx="1" gridy="1" gridwidth="1"
gridheight="1" weightx="90.0" weighty="0.0" fill="HORIZONTAL"/>
</constraints>
<label id="labelAuthor" text="Author"/>
<constraints>
<gridbag gridx="0" gridy="2" gridwidth="1"
gridheight="1" weightx="0.0" weighty="40.0" anchor="EAST" fill="NONE"/>
</constraints>
<textfield id="tfAuthor" columns="40" />
<constraints>
<gridbag gridx="1" gridy="2" gridwidth="1"
gridheight="1" weightx="90.0" weighty="0.0" fill="HORIZONTAL"/>
</constraints>
<label id="labelISBN" text="ISBN"/>
<constraints>
<gridbag gridx="0" gridy="3" gridwidth="1"
gridheight="1" weightx="0.0" weighty="40.0" anchor="EAST" fill="NONE"/>
</constraints>
<textfield id="tfISBN" columns="40" />
<constraints>
<gridbag gridx="1" gridy="3" gridwidth="1"
gridheight="1" weightx="0.0" weighty="0.0" fill="HORIZONTAL"/>
</constraints>
<label id="labelPublisher" text="Publisher"/>
<constraints>
<gridbag gridx="0" gridy="4" gridwidth="1"
gridheight="1" weightx="0.0" weighty="40.0" anchor="EAST" fill="NONE"/>
</constraints>
<textfield id="tfPublsiher" columns="40" />
<constraints>
<gridbag gridx="1" gridy="4" gridwidth="1"
gridheight="1" weightx="0.0" weighty="0.0" fill="HORIZONTAL"/>
</constraints>
</controls>
<!--
Finally, pack and show the dialog.
-->
<methodCall refid="BookStore" method="pack" />
<methodCall refid="BookStore" method="setDefaultCloseOperation">
<parameter>
<constant name="javax.swing.WindowConstants.DISPOSE_ON_CLOSE" />
</parameter>
</methodCall>
<methodCall refid="BookStore" method="setVisible">
<parameter>
<value type="boolean" data="true" />
</parameter>
</methodCall>
<property name="size">
<ref refid="window.size"/>
</property>
</window>
Ramon Williamson
|