So i want to remove the Integer from the ArrayList that i already have put into the normal Array.
What i have right now is:
int[] playersArray = null;
ArrayList<Integer> spelers = new ArrayList<Integer>();
the table.length u see under here is the amount of tables there are, the table[j].length is the amount of players each table can get. It works good but it removes the wrong Integer from the PlayerList, it removes the next one, not the one thats put into the playersArray.
for(int j = 0; j < table.length; j++){
playersArray = new int[table[j].length];
for(int i = 0; i < table[j].length; i++){
playersArray[i] = playersList.get(i);
playersList.remove(i);
}
table[j] = playersArray;
System.out.println("tafel: " + (j+1) + " " + Arrays.toString(tafel[j]));
}