
i have one text field ,in that it taking time in seconds for example 1560 seconds,but i need in the format like example: 09days:10 hrs:10 mins. i need code for change this
thankls in advance

import java.util.*;
import java.text.*;
import javax.swing.*;
import java.awt.event.*;
class ConvertSeconds{
public static void main(String[] args)
{
JFrame f=new JFrame();
JLabel lab=new JLabel("Enter seconds: ");
final JTextField text=new JTextField(20);
JButton b=new JButton("Convert");
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
int hr, mn,sec,day;
long s = Long.parseLong(text.getText());
day=(int)s/86400;
hr = (int)(s/3600);
int rem = (int)(s%3600);
mn = rem/60;
sec = rem%60;
String hrStr = (hr<10 ? "0" : "")+hr;
String mnStr = (mn<10 ? "0" : "")+mn;
String secStr = (sec<10 ? "0" : "")+sec;
JOptionPane.showMessageDialog(null,day+" days, "+hrStr+ "hrs, "+mnStr+ "minutes "+secStr+" seconds.");
}
});
f.setLayout(null);
lab.setBounds(10,10,100,20);
text.setBounds(120,10,100,20);
b.setBounds(120,40,100,20);
f.add(lab);
f.add(text);
f.add(b);
f.setVisible(true);
f.setSize(300,100);
}
}