front end kiwe ui handling part ekata n back end kiwe ube db handling part eka. UI gana nam wadiyama danne na mama. back end eka gana nam awulak na goda dala denna puluwna.
thawa ekak. uba jTable ekata nikammane data danne. ohoma danne nathuwa TableModel ekak use karanna.
Code:
Object rowData[][] = {{"Row1-Column1", "Row1-Column2", "Row1-Column3"},
{"Row2-Column1", "Row2-Column2", "Row2-Column3"}};
Object columnNames[] = {"Column One", "Column Two", "Column Three"};
TableModel model = new DefaultTableModel(rowData, columnNames);
tblData.setModel(model);
in this way u can simply update the data in the table. you just have to update the model and set it. rather than creating the jTable when you want to feed data to the table this is the standered way.
if you want, if the user is supposed to select data from the table you can use
Code:
int selectedIndex = tblData.getSelectionModel().getMinSelectionIndex();