| Author |
how to display textfield in a gridbaglayout
|
Josh Raj
Greenhorn
Joined: Feb 04, 2008
Posts: 7
|
|
hi all, Using a gridbag layout & constaints i want to place a small textfield and a button near to it.when the applet window is maximized the textfield will expand upto 40-50% of the window but the button will be of same size and near to the textfield without much change.I tried a lot but the text button when maximized is moving awat frm the textfield.Help Me.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
|
|
Welcome to the Ranch. Go and find Cay Horstmann's GBC class, read the link about "strike fear" and study the class. This makes GridBag much easier to use. Difficult to tell what is going on without seeing code, but make sureYou set a big "x weight" on the Component you want to change size.You set a 0 weight on the Component you want to stay the same size.You set anchors on the componentsYou set a fill (probably HORIZONTAL) on the text field.
|
 |
Craig Wood
Ranch Hand
Joined: Jan 14, 2004
Posts: 1535
|
|
|
|
 |
 |
|
|
subject: how to display textfield in a gridbaglayout
|
|
|