Here you can find the source of getFileName()
public static String getFileName()
//package com.java2s; //License from project: Open Source License import java.sql.Date; import java.text.SimpleDateFormat; public class Main { public static String getFileName() { String fileName = ""; SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); Date curDate = new Date(System.currentTimeMillis()); fileName = formatter.format(curDate) + ".png"; return fileName; }//www . j av a 2 s . co m }