Custom Component Scrolling
I am attempting to create a custom component that works like a JTextPane. I am extending JComponent to do so.
Everything is going find but I run in to a little problem. I would like my component to work inside a JScrollPane. At the moment it scrolls just fine, but when text reaches the bottom I would like it to automatically adjust the viewport of the JScrollPane so as to keep up with the text. Basically just like the JTextPane does... When the text reaches out of the bounds of the current viewport the pane is expanded and the JScrollPane automatically adjusts.
I thought there would be a method to maybe override by implementing the scrollable interface but no luck. Does anyone know how I might go about making my Text automatically scroll when the text reaches the bottom?