void (String rating) { double dblRating = 0d; if (rating != null) { try { dblRating = Double.parseDouble(rating); } catch (NumberFormatException ignore) { } } final int intRating = (int)dblRating; for (int i = 0; i < intRating; i++) { myLabels[i].setIcon(STAR); } if (intRating < MAX_RATE) { myLabels[intRating].setIcon(STARs[((Double)(dblRating * 10)).intValue() % 10]); for (int i = 1 + intRating; i < MAX_RATE; i++) { myLabels[i].setIcon(IconLoader.getDisabledIcon(STAR)); } } }