From e862c15b01684ae7c0fad17979ec43233a41b00a Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Fri, 12 Aug 2022 19:07:38 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-72634=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=8D=A1=E9=A1=BF=E4=BC=98=E5=8C=96=E4=B8=80=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/gui/date/JDateDocument.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/date/JDateDocument.java b/designer-base/src/main/java/com/fr/design/gui/date/JDateDocument.java index 008d01853c..f2e159463f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/JDateDocument.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/JDateDocument.java @@ -26,7 +26,7 @@ public class JDateDocument extends PlainDocument{ ** 调用者:类JDateDocument *******************************************************************/ public JDateDocument(JTextComponent tc, SimpleDateFormat dateFormat) throws - UnsupportedOperationException { + UnsupportedOperationException{ //当前日期构造 this(tc, dateFormat, getCurrentDate(dateFormat)); } @@ -34,14 +34,15 @@ public class JDateDocument extends PlainDocument{ public JDateDocument(JTextComponent tc, SimpleDateFormat dateFormat, String initDateTime) throws - UnsupportedOperationException { + UnsupportedOperationException{ //设置当前日期格式 setDateFormat(dateFormat); //保存操作的文本框 textComponent = tc; - try { + //设置显示为当前日期,同时完成显示的格式化 + try{ insertString(0, initDateTime, null); - } catch (BadLocationException ex) { + } catch(BadLocationException ex){ throw new UnsupportedOperationException(ex.getMessage()); } }