The problem comes from an inappropriate static
keyword.:
public static int [][] data;
static
means that the value of that variable will be the same for all your instances. Instead, put your data
inside your SwitchTableModel
and don't make it static
. This will solve your issues immediately.
Something like:
public class SwitchTableModel extends AbstractTableModel {
private int[][] data;
//... the rest of your current code.
}