Hello. Test program "Time of arrival-care staff." There is JComboBox which is filled from a DB (myaql). When you click on the "Arrived" button by an employee, the time for pressing this button is added to the database and displayed in the JTable. The problem is that each new employee should be displayed in a new line, and now he is simply replaced by a subsequent query.
comeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String user = (String) comboBox.getSelectedItem(); try { ResultSet rs = preparedStatement(String.format(query,user)).executeQuery(); table.setModel(resultSetToTableModel(rs)); } catch (SQLException e1) { e1.printStackTrace(); } pack(); } }); The resultSetToTableModel () method is a library method rs2xml.jar