日期:2014-05-20 浏览次数:20694 次
textcomponent.addCaretListener(new CaretListener(){ @Override public void caretUpdate(CaretEvent e){ if(textcomponent.getSelectionStart() != textcomponent.getSelectionEnd()){ // enable } else { // disable } } });