Results 1 to 3 of 3
Thread: Gidbag Question
- 01-20-2011, 12:36 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 8
- Rep Power
- 0
Gidbag Question
hello, am tying to get this effect

Using a gridBagLayout, but i cant get the textFiled to be longer then the Label?
I knew am a complete noob, and cant find anny tutorials for doing this, but if i can figure out how to only do this i think am golden, all workes well if i add 3 tabels ontop, but i dont want that :/Java Code:pane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; label = new JLabel("Label 1"); c.gridx = 0; c.gridy = 0; pane.add(label, c); input = new JTextField(""); c.weighty = 1.0; c.gridwidth = 3; //3 columns wide c.gridx = 1; c.gridy = 0; input.setSize(40,input.getHeight()); pane.add(input, c);
Thanks!
- 01-20-2011, 07:26 PM #2
Use weightx, not gridwidth. And construct your JTextFields with an int columnsize.
db
- 01-20-2011, 07:35 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
Question concerning question marks and colons
By jim01 in forum New To JavaReplies: 17Last Post: 01-14-2011, 12:05 AM -
Question mark colon operator question
By orchid in forum Advanced JavaReplies: 9Last Post: 12-19-2010, 08:49 AM -
Question about what this do.
By Syfer in forum New To JavaReplies: 1Last Post: 07-03-2010, 08:35 AM -
RMI question
By alvandrood in forum New To JavaReplies: 1Last Post: 09-14-2009, 12:36 PM -
question
By zizou147 in forum New To JavaReplies: 13Last Post: 07-04-2008, 07:05 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks