Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Remove all the selected rows of jTable at same time after press a button  RSS feed

 
Jrcastro Ribeiro
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys a need to remove the rows that are selected after i check if the checkbox is true.
Example: the rows 0,1,4,5 are marked as true, after that I will add these lines in a list, and then just remove only the lines that are on the list at same time after the button is pressed.


That's is my code: I have a collum that is a checkbox, then a check if is selected and add the corresponding line to the LIst.





With this code i can remove one by one. Any ideas how i can remove all the lines after a press the button?

 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need two loops:

1. the first loop will go from 0 to the end of the TableModel. This loop will copy the line to the List.

2. the second loop will go from the end of the TableModel to zero to remove each selected row.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!