Hi Rudy,
I think I can help you out. Think physically about how would you like the layout of the components. A frame can have as many panel as you want. You can create panel within panel. You situation is not that bad.
I assume you have previously created the label and text box!
first create 1 panel for label.
//LAYOUT THE LABLES IN ONE PANEL
JPanel panLabel = new JPanel();
panLabel.setLayout(new GridLayout(0,1)); // row, column
panLabel.add(lblFirst); //add the label
panLabel.add(lblLast); //add another label
create another panel to hold the text box.
//LAYOUT THE TEXT FIELD
JPanel panField = new JPanel();
panField.setLayout(new GridLayout(0,1));
panField.add(txtFirst);
panField.add(txtLast);
//create a content panel to hold the above two panels
JPanel panContent = new JPanel();
panContent.setBorder(BorderFactory.createEmptyBorder(20,20,20,20)); //set the panel distance from the edge of the frame
panContent.setLayout(new BorderLayout());
panContent.add(panLabel, BorderLayout.WEST);
panContent.add(panField, BorderLayout.EAST);
And that it is! Let me know if you can make it. I hope I can provide further assistance. Good luck.
Mindy Wu
