0

Please help . I am writing a fairly extensive project, and I came across a problem that I can not solve. I have a "JFrame.setRows (tableName)" method that returns a filled two-dimensional array. I would like to display this array in Jtable. Number of columns in Jtable == number of columns in "JFrame.setRows (tableName)"; I used the addRow () method;

 String[] sys=new String[x];
        for(q=0;q<9;q++){
           for(r=0;r<x;r++){
                 sys[r]=(String)JFrame.setRows(tableName)[r][q];
                 System.out.println(sys[r]);
               model.addRow(new String[]{sys[r]});

            }
        }

The result of my program is that the results of the table "JFrame.setRows (tableName)" [] [] are displayed in one Jtable column. Can anyone improve my code? Is there a better way to assign an array [][] to JTable (I'm using Netbeans) Any help will be appreciated!

0 Answers0