java - Change the width of JTable column -
i need change column width size of jtable
. please @ following code use display values. don't know how maximize width of table column.
please let me know how configure code.
public void displaytable(jtable table){ vector columns = new vector(getindividual(0).chromosomecolumncount()+1); columns.add("staff names"); for(int i=0; i<getindividual(0).chromosomecolumncount(); i++){ columns.add(rostermanager.getday(i)); } vector data = new vector(); vector row; for(int row1=0; row1<getindividual(0).chromosomerowsize(); row1++){ row = new vector(getindividual(0).chromosomecolumncount()); row.add(rostermanager.getnurse(row1).getempname()); for(int col=0; col<getindividual(0).chromosomecolumncount(); col++){ row.add(getindividual(0).getshift(row1, col).getshiftname()); } data.add(row); } defaulttablemodel tablemodel = new defaulttablemodel(data, columns); table.setmodel(tablemodel); }
setpreferredwidth(27) can used. inside method have add dimension.
Comments
Post a Comment