Browse Source

REPORT-72634 设计器卡顿优化一期

feature/x
John.Ying 2 years ago
parent
commit
e862c15b01
  1. 9
      designer-base/src/main/java/com/fr/design/gui/date/JDateDocument.java

9
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());
}
}

Loading…
Cancel
Save