How to prevent JScrollPane arrow key handling from moving caret when Scroll Pane wraps Text Pane
问题 I have the following requirements: I need a scrollable JTextPane. The user may type into this text pane, or text may be inserted into it that is not typed by the user. Think something like an IM window. Although the window must be scrollable to allow the user to review text previously typed, the caret should never move from its position at the end of the text. Any text entered by the user will always appear at the end. In JTextPane, when the user scrolls with the scroll bar, the caret does