I have a JScrollPane containing a JPanel and, in turn, a JList. I want for the viewport to always show the end of the list (from which items are being removed or added). I can accomplish this manually by dragging the ScrollBar to the bottom, where it stays, just the way I want it to. What should I do to accomplish this automatically?
I have a JScrollPane containing a JPanel and, in turn, a JList . I
Share
It should be simple to do. Just use JList’s
ensureIndexIsVisiblemethod and pass it the last index in the list (size – 1).