Advertisement
seba101

asdasdasdasd

Feb 17th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package databaseprogram;
  7.  
  8. import java.util.ArrayList;
  9. import javax.swing.table.AbstractTableModel;
  10.  
  11. /**
  12. *
  13. * @author Issues
  14. */
  15. public class TableModel extends AbstractTableModel{
  16.  
  17. private final String[] title = {"IDPracownika","Imie","Nazwisko","Stanowisko"};
  18. ArrayList<WorkersTable> data = new ArrayList<>();
  19.  
  20. public TableModel(ArrayList<WorkersTable> data) {
  21. this.data = data;
  22. }
  23.  
  24. @Override
  25. public int getRowCount() {
  26. throw new UnsupportedOperationException("Not supported yet.");
  27. }
  28.  
  29. @Override
  30. public int getColumnCount() {
  31. return title.length;
  32. }
  33.  
  34. @Override
  35. public Object getValueAt(int rowIndex, int columnIndex) {
  36. WorkersTable d = data.get(rowIndex);
  37. switch(columnIndex)
  38. {
  39. case 1: return d.getIDWorkers();
  40. case 2: return d.getName();
  41. case 3: return d.getSurname();
  42. case 4: return d.getPosition();
  43. case 5: return d.getLogin();
  44. }
  45. return 0;
  46. }
  47.  
  48. public void SetValueAt(int row, int col){
  49.  
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement