I'm building a board game using java swing, and I'm using JLabels for the Tiles of the game, and JLabels for the pawns. My question, is there a way I can add the pawn on top of a Tile by doing something like this :
Tiles[currentPosition].add(pawnLabel);
with the code above the program is being executed but I cant see the pawn. If I use:
Tiles[currentPosition].add(pawnLabel, 1);
I'm getting this exception:
- illegal component position
Do you have any ideas?