Pisze program do obliczanias macierzy ale cos cienki jestem w javie!
Mam problem . nie wiem jak to zrobic zeby po wybraniu w box-e cyfry pojawiala mi sie tabela kwadratowa o takich rozmiarach. Pomocy!
oto kod :

import java.awt.;
import javax.swing.
;
import java.applet.;
import java.awt.event.
;

public class Macierze extends JApplet implements ActionListener{
public JTable t;
public JButton b;

public void init() {
    setSize(500,300);

    Color kolor = new Color(0,132,202);
    getContentPane().setBackground(kolor);
    getContentPane().setLayout(new GridLayout(0,2));

    JTable t = new JTable(20,20);

    t.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    JScrollPane scroll = new JScrollPane(t);
    scroll.setBorder(BorderFactory.createTitledBorder("Macierz kwadratowa"));
    getContentPane().add(scroll);

    JButton losowo = new JButton("Losowo");
    losowo.setBounds(400,60, 80,25);
    losowo.setBackground(Color.yellow);
    losowo.addActionListener(this);
    getLayeredPane().add(losowo);

    JButton ustaw = new JButton("Ustaw");
    ustaw.setBounds(400,160, 80,25);
    ustaw.setBackground(Color.yellow);
    ustaw.addActionListener(this);
    getLayeredPane().add(ustaw);

    String[] rozmiar = {"2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"};
    JComboBox box = new JComboBox(rozmiar);
    box.setBounds(260,10, 50,20);
    box.setBackground(Color.yellow);
    box.addActionListener(this);
    getLayeredPane().add(box);
}

public void actionPerformed(ActionEvent e) {
    String tmp = e.getActionCommand();
    if (tmp.equals("Usgaw"))
        t.setValueAt("A",1,1);

}

public void bClicked() {

}

}