0

got it. thanks :)

In GridBagLayout.. i have the code:

c.gridx = 0;
    c.gridy = 1;
    c.anchor = GridBagConstraints.[B]EAST[/B];
    gridbag.setConstraints( rice, c );
    add( rice ); //the Label
    c.gridx = 1;
    c.anchor = GridBagConstraints.[B]WEST[/B];
    gridbag.setConstraints( rice1, c );
    add( rice1 ); //the TextField

screenshot
im just wondering why the Rice(Label) is on the west side and Rice(TextField) on the east side?

The anchor property describes where the control is anchored within the cell. The gridx and gridy control the cell position. So in the above, you have the label in position x=0 and anchored to the east edge of that cell. The text field is in position x=1 (which is to the right of x=0), and anchored to the west edge. Is that what you wondered about?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.