NiftyGUI: Updating a Scroll Panel Programatically

I’ve got a chat window in my game and I would like to give the user the ability to scroll up through the messages. I can’t use the inherent Scroll Panel functionality since the control requires focus to do so, and it won’t have focus whenever the user would want to scroll (for example, when going to input something a user might want to look at what other people have said. At this time the focus will be on the text field).

I’ve been toying around with the scroll panel control to figure out a way to do it programmatically by calling the Scroll Panel’s setVerticalPos() method to no avail. Are there other ways of updating the scroll panel position in Java?

This is nifty I assume?

You can create your own scroll panel just by nesting two panels.

The outer panel is set to layout absolute inside.

The inner panel has whatever layout you want.

Move the Y position of the inner panel to scroll it within the outer panel.