JTextField time in HH:mm:ss
问题 I have the estimated time the it would take for a particular task in minutes in a float. How can I put this in a JFormattedTextField in the format of HH:mm:ss ? 回答1: JFormattedTextField accepts a Format object - you could thus pass a DateFormat that you get by calling DateFormat#getTimeInstance(). You might also use a SimpleDateFormat with HH:mm:ss as the format string. See also: http://download.oracle.com/javase/tutorial/uiswing/components/formattedtextfield.html#format If you're not