< prev index next >

src/java.desktop/share/classes/javax/swing/JList.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -3315,11 +3315,10 @@
                 } else {
                     s = new AccessibleStateSet();
                 }
 
                 s.add(AccessibleState.SELECTABLE);
-                s.add(AccessibleState.VISIBLE);
                 if (parent.isFocusOwner()
                     && (indexInParent == parent.getLeadSelectionIndex())) {
                     s.add(AccessibleState.ACTIVE);
                 }
                 if (parent.isSelectedIndex(indexInParent)) {

@@ -3328,10 +3327,15 @@
                 if (this.isShowing()) {
                     s.add(AccessibleState.SHOWING);
                 } else if (s.contains(AccessibleState.SHOWING)) {
                     s.remove(AccessibleState.SHOWING);
                 }
+                if (this.isVisible()) {
+                    s.add(AccessibleState.VISIBLE);
+                } else if (s.contains(AccessibleState.VISIBLE)) {
+                    s.remove(AccessibleState.VISIBLE);
+                }
                 s.add(AccessibleState.TRANSIENT); // cell-rendered
                 return s;
             }
 
             public int getAccessibleIndexInParent() {
< prev index next >