private static void newAuction() { boolean correct = false; String iName = ""; String iDesc = ""; while (!correct) { try { System.out.print("Please enter the items name > "); iName = in.readLine(); System.out.print("Please enter a description > "); iDesc = in.readLine(); correct = true; } catch (Exception e) { } } double minBid = 0; try { System.out.print("Please enter a minimum bid > "); minBid = Double.parseDouble(in.readLine()); } catch (Exception e) { System.out.println("Minimum bid has defaulted to 0."); } int days = 0; int hours = 0; int mins = 0; boolean correct2 = false; try { while (!correct2 && days >= 0 && hours >= 0 && mins >= 0) { System.out.print("Please enter the number of days that the Auction is running for > "); days = Integer.parseInt(in.readLine()); System.out.print("Please enter the number of hours in that day > "); hours = Integer.parseInt(in.readLine()); System.out.print("Please enter the number of minutes in that hour > "); mins = Integer.parseInt(in.readLine()); correct2 = true; } } catch (Exception e) { } long tte = days * 86400000 + hours * 3600000 + mins * 60000; Calendar cal = Calendar.getInstance(); Date d = cal.getTime(); tte = tte + d.getTime(); Random r = new Random(); int rnum = (int) tte % r.nextInt(9999); String iRef = loggedUser.substring(loggedUser.length() / 2) + rnum; a.addItem(new b(iRef, loggedUser, iName, iDesc, minBid, tte, 0.0, "")); }