- don't suppress deprecation warnings, instead look at the API for the replacements. In this case, table.show(true) should be replaced by table.setVisible(true) and table.enable(true) should be replaced by table.setEnabled(true)
- I take it that "d" is an existing table model. Don't use its names, use the names from "md" instead:
This will also prevent a possible error; TableModel indexes start at 0 whereas JDBC starts at 1, as does your loop.
- don't create new JScrollBars for the JScrollPane, it will create them itself already. You then throw these auto-generated scroll bars away to replace them with another set of newly created scroll bars.
Now to the original question. Do you want a radio button at the start of each row that allows you to select only one row? That will require a bit of work involving cell renderers and cell editors, and there already is a selection mechanism for JTable. First, specify to only allow one row to be selected:
Then you can click on the entire JTable and it will change the selection. You can then retrieve that selection as follows:
Setting the selection is a bit harder but not very much:
And there you have it; single row selection straight out of the box.