I have these four class variables:
private static final ImageIcon redKing = new ImageIcon("Images/redKingImage.png");
private static final ImageIcon blackKing = new ImageIcon("Images/blackKingImage.png");
private static final ImageIcon redChecker = new ImageIcon("Images/redCheckerImage.png");
private static final ImageIcon blackChecker = new ImageIcon("Images/blackCheckerImage.png");
and I use this method to set the icons to my checkerboard appropriately.
private void setImageOfChecker()
{
if(this.isKing == true){
if(isRed){
this.imageOfChecker = redKing;
}
else{
this.imageOfChecker = blackKing;
}
}
else{
if(isRed){
this.imageOfChecker = redChecker;
}
else{
this.imageOfChecker = blackChecker;
}
}
}
My issue now is that the icons are too big for the squares on the board and I'd like to know what would be the easiest way to rescale EACH of these images to a specific size (for example 16x16pixels) so that all the icons fit nicely on the board.