我在项目中使用app.filter('highlight', function() {
return function(text, selectedWord) {
if(selectedWord) {
var pattern = new RegExp(selectedWord, "g");
return text.replace(pattern, '<span class="highlighted">' + selectedWord + '</span>');
}
else {
return text;
}
};
});
时出现问题,JCalender
显示编译时错误。这是错误:
WebLookAndFeel()
,源代码是:
java.lang.ClassCastException: javax.swing.JComboBox cannot be cast to javax.swing.JSpinner$DefaultEditor
at com.alee.laf.spinner.WebSpinnerUI.updateEditorStyle(WebSpinnerUI.java:220)
at com.alee.laf.spinner.WebSpinnerUI.replaceEditor(WebSpinnerUI.java:198)
at javax.swing.plaf.basic.BasicSpinnerUI$Handler.propertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at javax.swing.JSpinner.setEditor(Unknown Source)
at com.toedter.calendar.JMonthChooser.<init>(Unknown Source)
at com.toedter.calendar.JCalendar.<init>(Unknown Source)
at com.toedter.calendar.JCalendar.<init>(Unknown Source)
at com.toedter.calendar.JDateChooser.<init>(Unknown Source)
at com.toedter.calendar.JDateChooser.<init>(Unknown Source)
at JavaProject2_25.initialize(JavaProject2_25.java:173)
at JavaProject2_25.<init>(JavaProject2_25.java:59)
at JavaProject2_25$1.run(JavaProject2_25.java:46)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)