Obnoxious JTextPane and JScrollPane problem.
I have written a Tailing program. All works great except for one really annoying issue with my JScollPane. I will do my best to explain the problem:
The program will continue tailing a file and adding the text to the JTextPane. When a user scrolls up on the JScrollPane, the program still adds the text to the bottom of the JTextPane and the user can continue to view what they need.
Here is the problem: I have text being colored throughout the text pane. For instance, the word ERROR will be in red. The problem is when the program colors the text, it moves the scroll pane to the line where word that was colored is at. I don't want that. If the user moves the scroll bar, I want the scroll bar to always stay there. I don't want the program to move to the text that was just colored.
Is there a way to turn that off? I can't find anything like that anywhere.
[890 byte] By [
bradwalla] at [2007-11-26 12:56:36]

# 1
Coloring text will not cause the scrollpane to scroll.
You must be playing with the caret position or something.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.
# 2
Thanks for the help. I was setting the caret position and didn't need to.That fixed the problem.I didn't think that posting code would be needed. Too much to post and show.Anyway, it works fine now.Thanks again,Brad
# 3
> Too much to post and show
For the future. A SSCCE is not you entire program. Its minimal demo code that shows the problem. There is a big difference. A SSCCE causes you to isolate the cause of the problem.
You got lucky this time that I recognized the problem. In the future you verbal description will probably not be enough.