I would like to force the user to read (at least scroll to the bottom of) all the text inside a javax.swing.JEditorPane
. This editor pane has a JScrollPane
, that can only add a vertical slider, if the text is too long to display. The text is not fixed length it can be one sentence (where it is already displayed on the page) or several pages long (then theuser has to scroll down with the slider).
There is a button, that the user can press, if he acknowledges the text. What can I write into the button's onclick event, that will test if the user has read all the text?
Edit: To check if the user scrolled to the bottom of the editor pane is fine. The scroll bar is not present in all cases.
Thanks for the help, Sziro.
Tto find out if the user has scrolled to the bottom of the pane, try:
if (editorPane.getVerticalScrollBar().getMaximum() ==
editorPane.getVerticalScrollBar().getValue())