I am trying to add JButton
to a JTable
but instead of viewing the button it views(javax.swing......). What is the correct way to add a button?
public void setTableSize(ArrayList<CarRental> List)
{
ArrayList<CarRental> ListToPrint= List;
DefaultTableModel model=(DefaultTableModel) PrintListTable.getModel();
model.setRowCount(0);
EditButton n=new EditButton();
Edit.addActionListener(n);
for(int j=0;j<ListToPrint.size();j++)
{
model.addRow(new String[]{j+"",ListToPrint.get(j).getName(),ListToPrint.get(j).getDays()+"",ListToPrint.get(j).getSize(),ListToPrint.get(j).getCarType(),ListToPrint.get(j).WithDriver(),ListToPrint.get(j).DailyFeesDetails(),ListToPrint.get(j).ComputeTotal()+"" });
model.setValueAt(Edit, j, 8);
}
}