I use a JTextpane in a JScrollpane and the contents of the Jtextpane currently displayed are,
Row1
Row2
Row3
Row4
I type CLEAR and on press of ENTER i need to display only the last line scrolling the other lines upwards like below,
Row4
caret at the end of last line(Row4) and while scrolling up the following should be displayed,
Row1
Row2
Row3
Note : I have used keybindings to get enter action and using if condition i get to know that clear is typed.
How can i achieve this please help.