Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

how can we auto generate ID on a button click and display in textfield

$
0
0
public class CalendarUtil

{

    private Calendar cal = null;

    public String getRemId()

    {

        cal = Calendar.getInstance();

        return "" + cal.get(Calendar.DATE) + (cal.get(Calendar.MONTH)+1) +        cal.get(Calendar.YEAR);

    }        
}



How can we auto generate ID on a button click that will contain the concatenation of date,month,year and a 3 digit counter starting form 000 and display it in a textfield? for eg:- 28122012001, 28122012002, etc and so on. Code that i have been trying is as above

How can we auto generate ID on a button click that will contain the concatenation of date,month,year and a 3 digit counter starting form 000 and display it in a textfield? for eg:- 28122012001, 28122012002, etc and so on. Code that i have been trying is as above

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>