changeset 4691:2e4258236920 jdk7u4-b227

7131752: [macosx] Multiselect List doesn't display scrollbar after consecutive additions Reviewed-by: anthony
author serb
date Thu, 26 Jan 2012 21:47:53 +0400
parents 3fe2884e7f05
children c0036a561b5a
files src/macosx/classes/sun/lwawt/LWListPeer.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/sun/lwawt/LWListPeer.java	Thu Jan 26 21:44:28 2012 +0400
+++ b/src/macosx/classes/sun/lwawt/LWListPeer.java	Thu Jan 26 21:47:53 2012 +0400
@@ -81,6 +81,7 @@
     public void add(final String item, final int index) {
         synchronized (getDelegateLock()) {
             getDelegate().getModel().add(index, item);
+            revalidate();
         }
     }
 
@@ -88,6 +89,7 @@
     public void delItems(final int start, final int end) {
         synchronized (getDelegateLock()) {
             getDelegate().getModel().removeRange(start, end);
+            revalidate();
         }
     }
 
@@ -95,6 +97,7 @@
     public void removeAll() {
         synchronized (getDelegateLock()) {
             getDelegate().getModel().removeAllElements();
+            revalidate();
         }
     }
 
@@ -151,6 +154,12 @@
         }
     }
 
+    private void revalidate() {
+        synchronized (getDelegateLock()) {
+            getDelegate().getView().invalidate();
+            getDelegate().validate();
+        }
+    }
 
     final class ScrollableJList extends JScrollPane implements ListSelectionListener {