Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Get the GWT ScrollPanel to start its vertical scrollbar at the bottom
  2. @Override
  3. protected void onLoad() {
  4.     scrollToBottom();
  5. }
  6.        
  7. Timer t1 = new Timer()
  8.         {
  9.             @Override
  10.             public void run()
  11.             {
  12.                 s1.getScroll().scrollToBottom();
  13.                 s2.getScroll().scrollToBottom();
  14.             }
  15.         };
  16. t1.schedule(20);
  17.        
  18. Schedule.scheduleDeferred(new Scheduler.ScheduledCommand(
  19.   public void execute() {
  20.     panel.getElement().setScrollTop(panel.getElement().getScrollHeight());
  21.   }
  22. ));