Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package databaseprogram;
- import java.util.ArrayList;
- import javax.swing.table.AbstractTableModel;
- /**
- *
- * @author Issues
- */
- public class TableModel extends AbstractTableModel{
- private final String[] title = {"IDPracownika","Imie","Nazwisko","Stanowisko"};
- ArrayList<WorkersTable> data = new ArrayList<>();
- public TableModel(ArrayList<WorkersTable> data) {
- this.data = data;
- }
- @Override
- public int getRowCount() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- @Override
- public int getColumnCount() {
- return title.length;
- }
- @Override
- public Object getValueAt(int rowIndex, int columnIndex) {
- WorkersTable d = data.get(rowIndex);
- switch(columnIndex)
- {
- case 1: return d.getIDWorkers();
- case 2: return d.getName();
- case 3: return d.getSurname();
- case 4: return d.getPosition();
- case 5: return d.getLogin();
- }
- return 0;
- }
- public void SetValueAt(int row, int col){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement