I have a program that displays a JTextArea within a JScrollPane. Basically, when anything is added to the text area, the vertical scroll bar scrolls down to the bottom. I want it to add a vertical scroll bar as soon as the text area becomes bigger than the scroll pane but I dont want the scroll bar to move down to the bottom of the pane. I want the user to be able to see the start of the data in the text area with the choice to scroll down when they wish.
I have the following code:
errorHold = new JScrollPane(errorArea); errorHold.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
I dont know if you change a setting on either the: (a) Scroll pane (b) scroll bar (c) text area (d) viewport