java - Receiving incorrect values from a JTable -


i trying retrieve , use values jtable after row has been selected using code:

@override public void valuechanged(listselectionevent e){     tablemodel tablemodel = this.mainframe.getviewerstablemodel();     this.mainframe.setviewerbuttonsenabled(         !((boolean)(tablemodel.getvalueat(e.getlastindex(), 1)))     ); } 

in scenario, table has 1 row value of true, , of false.

the strange thing first time select row, value given correct, whether row holding true, or 1 false, subsequent selections result in getting true, no matter row pick.

well, fixed it.

instead of getting required boolean in event handler class, made method in mainframe class retrieves boolean table. issue resolved.

thank helped.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -