unable to see textfileds using gridbaglayout

Hi,

I am desiginig screen that has 1 row of 3 textfields and an add button.when I click the button ,three text boxes are added to the screen and the add button should move down.The screen can have 10 rows of 3 text boxes.

I am using gridbaglayout .I tested with first row of 3 text buttons.But I when I click the button,I dont see the text boxes.but when I make the screen large,I can see it.

Please assist.

Thanks.

[446 byte] By [tutikashilpaa] at [2007-11-27 6:21:41]
# 1
when you add components in the manner you describe, you need to revalidate the parent container after adding the components.[container].revalidate();[container].repaint();//sometimes required, sometimes not
Michael_Dunna at 2007-7-12 17:38:19 > top of Java-index,Desktop,Core GUI APIs...
# 2
getContentPane().validate();if it is a panel, code should bepanel.validate();
AnanSmritia at 2007-7-12 17:38:19 > top of Java-index,Desktop,Core GUI APIs...
# 3

i have encountered the same problem before.

what i did first was to check whether the sizes of my text fields are too large/long.

now, to be able to arrange your buttons the way you want them to,

try to separate the text fields from the button by using JPanel. create a first panel which contains all the textfields and their labels, then create a second panel for your buttons.

=)

dadaa at 2007-7-12 17:38:19 > top of Java-index,Desktop,Core GUI APIs...