December 18th, 2012, 06:01 AM
I have Jtable having employee details. And I want to select some employees from table randomly and assign them them training. How I can select employees randomly from Jtable and extract data.
December 19th, 2012, 04:18 AM
Randomly selecting employees
- First, call the getModel() method of your JTable to grab the data model backing the display.
- Then, use a random number generator to generate some random numbers within the range of 0 to the total row count -1
- Using the generated random number, call to getValueAt() or setValueAt() method on your table data model to manipulate/extract data to/from a specific cell.
When the programming world turns decent, the real world will turn upside down.