I want to update a jtable depending on the info provided in the text fields and on clicking jbutton. Each row of the jtable should be updated on clicking the button one time. I am able to update the first row by giving apt data[actual-row][actual-col]. But I need help for creating the same for every row using some loop or collection.
btn7.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
{
new Thread()
{
public void run()
{
data[1][0] = tf1.getText().substring(tf1.getText().lastIndexOf('- ')+1,tf1.getText().length() );
data[1][1] = tf2.getText();
data[1][2] = tf3.getText();
data[1][3] = tf4.getText();
data[1][4] = tf5.getText();
data[1][5] = tf6.getText();
data[1][6] = tf7.getText().substring(0,tf7.getText().lastIndexOf(' ')+1);
data[1][7] = (String)cb.getSelectedItem();
data[1][8] = tf8.getText();
}
}.start();