This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cant use "getSelectedRow" ?  RSS feed

 
kelvin cheung
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,



studentTable is a JTable.

i get this error :

java.lang.ArrayIndexOutOfBoundsException: -1

but the getSelectedColumn() works fine.

why is that?

kelvin.
 
kelvin cheung
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

nevermind guys.

i did a stupid thing.

i took this :
studenter.removeRow( getSelectedRow() );

before this :
int rad = studentTabell.getSelectedRow();

thats why it returns -1 because it could not find any selected.


this problem is solved!

regards,
kelvin.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!