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