Skip to content

Commit

Permalink
SPARK-1398 fixed UiThreadViolation in scrollToBottom
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12550 b35dd754-fafc-0310-a699-88a17e54d16e
  • Loading branch information
Holger Bergunde committed Jun 29, 2011
1 parent 589494f commit 409934c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/java/org/jivesoftware/spark/ui/ChatRoom.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
Expand Down Expand Up @@ -616,8 +617,15 @@ public void scrollToBottom() {
transcriptWindow.setCaretPosition(lengthOfChat);

try {
JScrollBar scrollBar = textScroller.getVerticalScrollBar();
scrollBar.setValue(scrollBar.getMaximum());
final JScrollBar scrollBar = textScroller.getVerticalScrollBar();
EventQueue.invokeLater(new Runnable() {

@Override
public void run() {
scrollBar.setValue(scrollBar.getMaximum());
}
});


}
catch (Exception e) {
Expand Down

0 comments on commit 409934c

Please sign in to comment.