0

Actually what i want to do is that on a click of a button , the selected row of the jTable increments to next row so that i can fetch that row to play the next song...how can i do that???

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by TheWhite
0

In reposnse to a the buttons actionevent, get the curently selected row's number, add 1, selec that row. See JTable and DefaultListSelectionModel in the API.

0

now in another action performed of a button i want to get the selected row number so that i can add 1 to it ..plz tell me the function to retrieve the current row number so that i can add 1 to it and i want that selected row to change to next row wen i click d button as well..

0

Yes but it wont work because it will just play the next song taking in view the selected row but is there a way to change the selected row myself???? then it would work definately!

0

You want changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)

* toggle: false, extend: false. Clear the previous selection and ensure the new cell is selected.
* toggle: false, extend: true. Extend the previous selection from the anchor to the specified cell, clearing all other selections.
* toggle: true, extend: false. If the specified cell is selected, deselect it. If it is not selected, select it.
* toggle: true, extend: true. Apply the selection state of the anchor to all cells between it and the specified cell.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.