Ich habe ein Rahmenlayout und möchte dem mittleren Bereich ein Rasterlayout hinzufügen. Ich kann jedoch kein Raster definieren und dann meinen mittleren Rand hinzufügen. Wie kann ich das machen?Einbetten eines Rasterlayouts in ein Rahmenlayout in Java
public Liability_Calculator(String s)
{
super(s);
setSize(325,200);
c = getContentPane();
c.setLayout(new BorderLayout());
//the top label
total = new JLabel("Total monthly liabilities ", JLabel.CENTER);
c.add(total, BorderLayout.NORTH);
//the grid
GridLayout grid = new GridLayout(2,2);
text_field1 = new JTextField(7);
//I GET AN ERROR HERE!!!!!!!
grid.add(text_field1);
//AND ERROR HERE!!!!!!!!!!!!!
c.add(grid, BorderLayout.CENTER);
setVisible(true);
}