private void updateDisplay() { Security security = watchlistItem.getSecurity(); setName(security.getDescription()); Quote quote = security.getQuote(); if (quote != null) { double last = CurrencyConverter.getInstance() .convert( quote.getLast(), security.getCurrency(), watchlistItem.getParent().getCurrency()); double close = CurrencyConverter.getInstance() .convert( security.getClose(), security.getCurrency(), watchlistItem.getParent().getCurrency()); setValue(numberFormatter.format(last)); if (security.getClose() != null) { double change = last - close; double percentage = change / close * 100; String prefix = ""; if (change > 0) prefix = "+"; setChange( prefix + numberFormatter.format(change) + " (" + prefix + percentageFormatter.format(percentage) + "%)"); } if (quote.getDate() != null) setTime(formatter.format(quote.getDate())); if (lastValue != null) { if (quote.getLast() > lastValue.doubleValue()) setImage(up); else if (quote.getLast() < lastValue.doubleValue()) setImage(down); else setImage(equal); } lastValue = new Double(quote.getLast()); } getParent().layout(true, true); }