1
좋아, 이것은 간단하게 들리지만 여전히 문제가됩니다. 나는 jtextarea와 문서 필터를 사용한다. 나는 사용자가 "a"를 누르 자마자 println을 통해 인쇄 할 현재 텍스트를 원한다. 예를 들어,JTextArea 및 DocumentFilter가 현재 텍스트로 인쇄되었습니다.
public void replace(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException {
if ("a".equals(text)) {
String c = fb.toString();
System.out.println(c);
}
super.replace(fb, offset, length, text, attrs);
}
}
나는 "도움"을 입력하고 콘솔에서 [email protected]을 얻을 : 내가 사용! 하지만 왜? D : 감사합니다 많은
오늘은 내 영웅입니다! –