java - Values setValueAt() -


i'm trying create table , , i'm using setvalueat() add values table.

some of code :

  int nalt=1+((altmax-altmin)/incr);     tabela=new jtable(new string[nalt][6],colunas);      for(int i=0;i<=(nalt-1);i=i){         for(int j=altmin;j<=altmax;j=j+incr){             tabela.setvalueat(""+j, i, 0);          i=i+1;         } 

the thing , if leave value = (""+j) works fine, if leave (j) alot of errors.

i tried this:

   int nalt=1+((altmax-altmin)/incr);     tabela=new jtable(new string[nalt][6],colunas);      for(int i=0;i<=(nalt-1);i=i){         for(int j=altmin;j<=altmax;j=j+incr){             object ty=new integer(j);             tabela.setvalueat(ty, i, 0);          i=i+1;         } 

and :

        int nalt=1+((altmax-altmin)/incr);     tabela=new jtable(new string[nalt][6],colunas);      for(int i=0;i<=(nalt-1);i=i){         for(int j=altmin;j<=altmax;j=j+incr){             tabela.setvalueat(new integer(j), i, 0);          i=i+1;         } 

but still got alot of errors . first way , leaving (""+j) , need value , , i'm getting trouble converting object int . if me trying understand why i'm getting errors nice. or me converting object int . mean need use .getvalueat(...) , think i'm getting troubles converting because obect (""+number) , or maybe im wrong .

thanks

the problem setup jtable string array: new jtable(new string[nalt][6],colunas); try add integer: tabela.setvalueat(new integer(j), i, 0);. solution set table integer array in first place:

tabela=new jtable(new integer[nalt][6],colunas); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -