hello i m designing a registration form in swing, initial i added two textfields and labels to my frame, but the only one textbox is visible to me and when i maximize the screen, label is also visible to me but inside the text box, but second label and text boxes are not visible to me..
i m using GridBagLayout.
here is my code:
I haven't run your code, but I suspect the problem is due to some of the components being added with a gridwidth/height = 0. What exactly did you hope to achieve by that?
There are no new questions, but there may be new answers.
Joined: Aug 20, 2011
well i want my first label in first line first column, first textbox in first line second column.
then second label in second line first column and second text box in second line second column...likewise..just like a registration form.
that's y i did like this:
also i want when i maximize my form my text box should fill horizontally, but gbConstraints.fill is not working for me.
You have pasted only a part of the API docs for weightx - which indicates that you have read only a part of that. You have to read it in full and then try. Read on the part where 'all weightx is 0'. I guess you don't want me to paste the apidoc all over here...