[Solved] GUI Form Creating By Hand [closed]


First, the label for radios is not shown, because you don’t create it and add it to panel. Create it and add it to panel before radioB1. Also, you should add some invisible (empy) label before radioB2 (or use some other filler component to fill the cell – perhaps this could help: http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html#filler).

Also, you could add another filler component to panel instead of saveButton. Then I would create another panel (buttonPane), that would contain both save and cancel buttons and add this buttonPane to the main panel instead of cancelButton. The panel for buttons could use BoxLayout and in between buttons could be horizontal glue (as you can see in the link above).

That should be it. But there’s one warning here. You are creating JTextFields in the loop in such way, that you cannot refer to them later, ie. when you will need to get the text. You should keep their references as individual variables, or add them to an array, so you can get the values, when the update button is pressed.

0

solved GUI Form Creating By Hand [closed]