private Image getImageForFigure(int color, int type) {
        String filename = "";
        
        filename += (color == Figure.COLOR_WHITE ? "w" : "b");
        
        switch (type) {
            case Figure.TYPE_BISHOP:
                filename += "b";
                break;
            case Figure.TYPE_KING:
                filename += "k";
                break;
            case Figure.TYPE_KNIGHT:
                filename += "n";
                break;
            case Figure.TYPE_PAWN:
                filename += "p";
                break;
            case Figure.TYPE_QUEEN:
                filename += "q";
                break;
            case Figure.TYPE_ROOK:
                filename += "r";
                break;
            case Figure.TYPE_MAHARAJA:
                filename += "k";
                break;
        }
        filename += ".png";
        URL urlFigureImg = getClass().getResource("img/" + filename);
        return new ImageIcon(urlFigureImg).getImage();
    }