Is it possible to add buttons inside the JTable cell along with data? What I am trying to do is to create a table with columns which display data(number) from the database,
As discussed in the tutorial you'll need both a renderer to display your value and an editor to detect events from the cell being edited. In this example, the Component
is a JCheckBox
. Note that this requires a custom DataModel
that extends AbstractTableModel
to supply the correct Class
for a given column. Joonas' suggestion to use JSpinner
is a good one that works well.