// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.awt.*;

import javax.swing.*;

public class IterationGUI extends JFrame {
    private JPanel p1,p2,p3;
    private JTextArea output;
    public JTextField[] felt = new JTextField[30];
    public IterationGUI(){
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        getContentPane().setLayout(new BorderLayout(2,5));
        output = new JTextArea();
        getContentPane().add(output, BorderLayout.NORTH);
        p1 = new JPanel();
        p1.setLayout(new GridLayout(10,2));
        getContentPane().add(p1, BorderLayout.WEST);
        p2 = new JPanel();
        p2.setLayout(new GridLayout(10,2));
        getContentPane().add(p2, BorderLayout.CENTER);
        p3 = new JPanel();
        p3.setLayout(new GridLayout(10,2));
        getContentPane().add(p3, BorderLayout.EAST);
        for(int i = 0; i < 10; i++) {
            felt[i] = new JTextField(10);
            p1.add(new JLabel("felt" + i + ": "));
            p1.add(felt[i]);
        }
        for(int i = 10; i < 20; i++) {
            felt[i] = new JTextField(10);
            p2.add(new JLabel("felt" + i + ": "));
            p2.add(felt[i]);
        }
        for(int i = 20; i < 30; i++) {
            felt[i] = new JTextField(10);
            p3.add(new JLabel("felt" + i + ": "));
            p3.add(felt[i]);
        }
        pack();
    }
    public static void main(String [] args){
        SwingUtilities.invokeLater(new Runnable()
                {
                    public void run()
                    {
                        IterationGUI gui = new IterationGUI ();
                        gui.setVisible(true);
                    }
                });
           
    }
}
