-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArtistsModel.java
64 lines (50 loc) · 1.64 KB
/
ArtistsModel.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* @author Yannis Exidaridis <[email protected]>
**/
package albums;
import javax.swing.table.AbstractTableModel;
/**
*
* @author yannis
*/
public class ArtistsModel extends AbstractTableModel {
private final String[] TableHeader;
private final Object[][] TableData;
private final String[][] OldData;
public ArtistsModel(Integer num) {
super();
TableHeader = new String[] {"Artist"};
TableData = new Object[num][1];
OldData = new String[num][1];
}
@Override
public int getColumnCount() {
return TableHeader.length;
}
@Override
public String getColumnName(int column) {
return TableHeader[column];
}
@Override
public int getRowCount() {
return TableData.length;
}
@Override
public Object getValueAt(int row, int column) {
return TableData[row][column];
}
@Override
public void setValueAt(Object value, int row, int column) {
TableData[row][column] = value;
}
@Override
public boolean isCellEditable(int row, int column) {
return true;
}
public void setOldValueAt(Object value, int row, int column) {
OldData[row][column] = value.toString();
}
public String getOldValueAt(int row, int column) {
return OldData[row][column];
}
}