// this method every time load the rackList from database and then display // it in table public void loadTableData() { int j = 0; while (j < tableModel.getRowCount()) { tableModel.removeRow(j); } rackList = dbValue.getRackDetail(tableid.getStoreId(comboBox1.getSelectedItem().toString())); for (int i = 0; i < rackList.size(); i++) { RackModel rack = rackList.get(i); tableModel.addRow(new Object[] {i + 1, rack.getRackName()}); } }
// for viewing the selected element details in table private void view() { boolean status = true; if (table1.getSelectedRowCount() != 1) { status = false; new ValidationMSG(this, "Please Select A Row from Table Then Click"); } if (status) { rack = rackList.get(table1.getSelectedRow()); textField1.setText(rack.getRackName()); textArea1.setText(rack.getRackDesc()); comboBox1.setSelectedItem(fieldName.getStoreName(rack.getStoreId())); } }