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

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?

ahhhh ok! i get it now.. thank you so much for explaining ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.