/** Creates new form NewDetailsFrame */ public ViewItemDetails(String itemId, ItemType item) { super(); String currency = null; this.itemId = itemId; setTitle("Item Id: " + itemId); if (item.getTitle() != null) { itemDetailString = item.getTitle(); // System.out.println("Found item: " + itemDetailString); } if (item.getPictureDetails() != null) { // System.out.println("Picture url is " + item.getPictureDetails().getGalleryURL()); try { java.net.URL url = new java.net.URL(item.getPictureDetails().getGalleryURL()); image = javax.imageio.ImageIO.read(url); } catch (java.io.IOException ie) { // ie.printStackTrace(); // System.out.println("Image not found!!!"); image = null; } } if (item.getCurrency() != null) { // System.out.println("Currency: " + item.getCurrency().value()); currency = item.getCurrency().value(); } if (item.getDescription() != null) { // System.out.println("Description: " + item.getDescription()); desc = item.getDescription(); } int i = 0; if (item.getBestOfferDetails() != null) { // System.out.println("Current bid: " + item.getBestOfferDetails()); details[i] = "Current Bid: "; if (currency != null) { values[i] = currency + " " + String.valueOf(item.getBestOfferDetails().getBestOffer().getValue()); } else { values[i] = String.valueOf(item.getBestOfferDetails().getBestOffer().getValue()); } i++; } if (item.getBuyItNowPrice() != null) { details[i] = "Buy it Now: "; // System.out.println("Buy it now: " + item.getBuyItNowPrice().getValue()); values[i] = String.valueOf(item.getBuyItNowPrice().getValue()); if (currency != null) values[i] = values[i] + " " + currency; i++; } if (item.getTimeLeft() != null) { // System.out.println("End Time: " + item.getTimeLeft().toString()); details[i] = "End Time: "; String timeLeft = ""; if (item.getTimeLeft().getDays() != 0) { timeLeft = item.getTimeLeft().getDays() + " Days "; } if (item.getTimeLeft().getHours() != 0) timeLeft = timeLeft + item.getTimeLeft().getHours() + " Hrs "; if (item.getTimeLeft().getMinutes() != 0) timeLeft = timeLeft + item.getTimeLeft().getMinutes() + " Mins "; if (item.getTimeLeft().getSeconds() != 0) timeLeft = timeLeft + item.getTimeLeft().getSeconds() + " Secs "; values[i] = timeLeft; i++; } if (item.getQuantity() != null) { // System.out.println("Quantity: " + item.getQuantity()); details[i] = "Quantity: "; values[i] = String.valueOf(item.getQuantity()); i++; } if (item.getLocation() != null) { // System.out.println("Location: " + item.getLocation()); details[i] = "Location: "; values[i] = item.getLocation(); } initComponents(); setVisible(true); }