I have a JFrame
Form which has JTextField
s, JCombobox
etc. and I am able to receive those values to variables and now I want to add the received data to JTable
in new row when user clicks Add or something like that.
I have created JTable
using net-beans the problem is what would be the code to add data from those variable to the rows of table. A basic example would be appreciated. I have tried numerous example and have added the code to ActionListener
of the JButton
but nothing Happens.
The Examples I tried are. How to add row in JTable? and How to add rows to JTable with AbstractTableModel method?
Any Help would be appreciated.
you can use this code as template please customize it as per your requirement.
here
DefaultTableModel
is used to add rows inJTable
, you can get more info here.