aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Selecting a row in a JTable using a RadioButton Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Selecting a row in a JTable using a RadioButton" Watch "Selecting a row in a JTable using a RadioButton" New topic
Author

Selecting a row in a JTable using a RadioButton

poornima sudharshan
Greenhorn

Joined: May 18, 2001
Posts: 18
How do I add a column with values to an existing JTable
which has been constructed using a AbstractTableModel.
Basically I have a completely constructed JTable, and for Selection of each row,I want to add a column with a RadioButton.By Selecting this RadioButton,the user selects the particular row.
Plz reply,
poornima.
ramandeep singh
Greenhorn

Joined: Jun 27, 2001
Posts: 20
Best way is to implement ur own model
I don't think it is possible w/o using a custom table model


Ramandeep Singh
Rick Fortier
Ranch Hand

Joined: Jun 04, 2001
Posts: 147
How do I add a column with values to an existing JTable
which has been constructed using a AbstractTableModel.

There is a method which has to be implemented in AbstractTableModel called getColumnCount. Just return one more that the columns are in the database. And then adjust by one your getValueAt() method by one column.
Basically I have a completely constructed JTable, and for Selection of each row,I want to add a column with a RadioButton.By Selecting this RadioButton,the user selects the particular row. Each column's renderer can be changed. Read about the getColumnClass, and setDefaultRenderer methods. But you don't need a radio button to let the user select a row. That behavior is already built into JTable
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Selecting a row in a JTable using a RadioButton
 
Similar Threads
JTable
JTable
JTable
JTable
JTable