Need help in Swing and Layouts

Hi buddies i need a help

am doing a small application and using gridbag layout for that and when i tried to use weightx that value is applied to all the components but i just want to give that value for a single component , then how to set the length for combobox like setting for textfield new textfield(30) pls.let me know the answer friends

thanx in advance

[379 byte] By [haiprathi@gmail.coma] at [2007-11-27 4:38:09]
# 1
http://java.sun.com/docs/books/tutorial/uiswing/layout/index.htmlIn future Swing related questions should be posted into the Swing forum.
cotton.ma at 2007-7-12 9:48:32 > top of Java-index,Java Essentials,Java Programming...
# 2

String[] str = {"one","two"};

JComboBox comboBox = new JComboBox(str);

GridBagConstraints gc = new GridBagConstraints();

gc.weightx = 1;

gc.weighty = 3;

gc.ipadx = 50; //for length of the component

panel.add(comboBox, gc);

//similarly for other components

AnanSmritia at 2007-7-12 9:48:32 > top of Java-index,Java Essentials,Java Programming...