This is what i need to do except the layout alone is being a pain and cant get it to do what i want even though i know how to make a flow and grid layout.
I'm using grid at the moment
layout.jpg
So my questions are
How do you tell it when the jlabels and textfields are supposed to stay on 1 line and when to go to a new line.
Also on the grid when I create a new column I don't see a difference at all and can't get it to move a thing to it.
If the flow layout works better please still tell me the above just for flow instead of grid or even do both if you want.
This is the basic layout code from my book and it works but I cant edit it to what I want.
import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JFrame; import java.awt.GridLayout; public class MortgageCalculator extends JFrame { public MortgageCalculator() { setLayout(new GridLayout(3,2,5,5)); add(new JLabel("First Name:")); add(new JTextField(8)); add(new JLabel("MI")); add(new JTextField(1)); add(new JLabel("Last Name")); add(new JTextField(8)); } public static void main (String [] args) { MortgageCalculator frame = new MortgageCalculator(); frame.setTitle("ShowGridLayout"); frame.setSize(200, 125); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }