< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, 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

@@ -494,14 +494,20 @@
         public void mouseClicked(final MouseEvent e) {
         }
 
         @Override
         public void mouseEntered(final MouseEvent e) {
+            if (spinner != null && !autoRepeatTimer.isRunning() && spinner == eventToSpinner(e)) {
+                autoRepeatTimer.start();
+            }
         }
 
         @Override
         public void mouseExited(final MouseEvent e) {
+            if (autoRepeatTimer.isRunning()) {
+                autoRepeatTimer.stop();
+            }
         }
 
         /**
          * Requests focus on a child of the spinner if the spinner doesn't have
          * focus.
< prev index next >