private void tbProductMouseClicked( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_tbProductMouseClicked if (tbProduct.getSelectedRow() < 0) { return; } if (evt.getClickCount() < 2) { return; } try { String id = tbProduct.getValueAt(tbProduct.getSelectedRow(), 0).toString(); Product e = provider.getByIdProduct(Long.parseLong(id)); if (e != null) { IShowPanel p = new AddNewProduct(); IControlPanel controlPanel = new ControlPanel(); controlPanel.setShowPanel(p); p.setControlShow(controlPanel); p.setDataShow(e); IHomePanel homePanel = new Home(); controlPanel.refresh(p); homePanel.setPanelControl(controlPanel); homePanel.showDefaut(); homePanel.setVisible(true); } } catch (Exception e) { JOptionPane.showConfirmDialog(this, e); } } // GEN-LAST:event_tbProductMouseClicked
private void loadTable() { List<Product> departments = provider.getListInformation(); tbProduct.setModel(new TableModelProduct(departments)); }