|
|
|
@ -10,6 +10,7 @@ import javax.swing.text.JTextComponent;
|
|
|
|
|
import javax.swing.text.PlainDocument; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
public class JDateDocument extends PlainDocument { |
|
|
|
|
private JTextComponent textComponent; //日期输入文本框
|
|
|
|
@ -49,6 +50,7 @@ public class JDateDocument extends PlainDocument{
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置当前日期格式 |
|
|
|
|
* |
|
|
|
|
* @param dateFormat SimpleDateFormat |
|
|
|
|
*/ |
|
|
|
|
public void setDateFormat(SimpleDateFormat dateFormat) { |
|
|
|
@ -57,6 +59,7 @@ public class JDateDocument extends PlainDocument{
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 取得当前日期格式 |
|
|
|
|
* |
|
|
|
|
* @return SimpleDateFormat |
|
|
|
|
*/ |
|
|
|
|
public SimpleDateFormat getDateFormat() { |
|
|
|
@ -65,6 +68,7 @@ public class JDateDocument extends PlainDocument{
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 取得当前系统日时 |
|
|
|
|
* |
|
|
|
|
* @return String |
|
|
|
|
*/ |
|
|
|
|
public static String getCurrentDate(SimpleDateFormat smFormat) { |
|
|
|
|