On Thu, 4 Jun 2020 19:46:03 +0200, Mike Wey wrote:
On 04-06-2020 02:06, Joel Christensen wrote:
On Wed, 3 Jun 2020 23:19:59 +0200, Mike Wey wrote:
On 03-06-2020 00:18, Joel Christensen wrote:
I've got scroll windows with wrap, but want to know how to scroll to the bottom in the code.
Like as follows:
text.setCursor(text.getText.length);
I believe you can scroll to the bottom using
setHadjustment
.I think it's
setVadjustment
, but I can't work it out without a code example - very little to go on. Would have to know the max height to set it to - says it's in pixels.You would probably do something like this:
Adjustment adj = scroledWindow.getVadjustment(); adj.setValue(adj.getUpper() - adj.getPageSize()); scrolledWindow.setVadjustment(adj);
To scroll to the bottom of the window.
Actually, it doesn't work when text is wrapped, (not to do with the size of the window view).