pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Whitcomb" <Roger.Whitc...@actian.com>
Subject RE: 2.0.2 How to move scroll bar to bottom of ScrollPane?
Date Tue, 04 Dec 2012 18:52:12 GMT
Hi Jason,
	The way we handle this case is to queue a callback that gets the Bounds of the last character
and calls "scrollAreaToVisible" with those bounds.  Like this:
	    ApplicationContext.queueCallback(new Runnable() {
		public void run() {
		    Bounds bounds = resultArea.getCharacterBounds(resultArea.getCharacterCount());

The reason you have to do the queued callback is that the painting code is what actually sets
the bounds, and so the value is not available until the repaint happens, and then the callback
is invoked right after that.

~Roger Whitcomb

-----Original Message-----
From: Jason Murray [mailto:icecreamguy39@gmail.com] 
Sent: Saturday, December 01, 2012 8:29 PM
To: user@pivot.apache.org
Subject: 2.0.2 How to move scroll bar to bottom of ScrollPane?

Right now, I have a TextArea set to refresh its text after the enter key is pressed.
This works just fine, but the scroll bar of the ScrollPane that the TextArea is in doesn't
automatically scroll down to the bottom where anything new would be.
Is there a method of ScrollPane that I could put inside an event listener to do this?
View raw message