java - How to use model.addRow() to add rows after the JTable is already added? -


public void initjtabpane() throws filenotfoundexception, ioexception{     //jtable bot shit      model = new defaulttablemodel() {             @override            public boolean iscelleditable(int row, int column) {                //only third column                return column == 4;            }         };     jt = new jtable();        // create couple of columns      model.addcolumn("col1");      model.addcolumn("col2");      model.addcolumn("col3");      model.addcolumn("col5");      // append row      model.addrow(new object[]{"name", "ip","country","specs"});        jt.setmodel(model);      panel1.add(jt);  } 

i can add rows doing model.addrow() in initjtabpane() method, cannot add rows in other methods. how come?

thanks, neil


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -