Currently I am printing my values for my swing worker timer in a label
.setText(days + " Days :" + hours + " Hours :" + mins + " Minutes : " + seconds + " Seconds elapsed")
I was wondering if it were possible to format this in a slightly neater way?
I’ve got a program that I’m working on now that uses
String.format(...)and a format String for this:Otherwise if you’re dealing with a Date object (I’m not), you could use a SimpleDateFormat object to better format your output.