File tree Expand file tree Collapse file tree
sources/net.sf.j2s.java.core/src/javax/swing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252import java .awt .event .MouseMotionAdapter ;
5353import java .awt .event .MouseMotionListener ;
5454
55+ import javajs .api .JSFunction ;
56+ import swingjs .JSToolkit ;
57+
5558/**
5659 * Manages all the <code>ToolTips</code> in the system.
5760 * <p>
@@ -375,22 +378,23 @@ void showTipWindow() {
375378 insideTimer .start ();
376379 tipShowing = true ;
377380 }
378- // System.out.println("TTM showTipWindow2");
379381 }
380382
381383 void hideTipWindow () {
382384 if (tipWindow != null ) {
383- // System.out.println("TTM hideTipWindow1");
384385 if (window != null ) {
385386 window .removeMouseListener (this );
386387 window = null ;
387388 }
388- tipWindow .hide ();
389+ @ SuppressWarnings ("unused" )
390+ Popup win = this .tipWindow ;
391+ // give this a few milliseconds, for continuity
392+ JSToolkit .dispatch (/** @j2sNative function() {win.hide$()} || */ null , 10 , 0 );
393+ // tipWindow.hide();
389394 tipWindow = null ;
390395 tipShowing = false ;
391396 tip = null ;
392397 insideTimer .stop ();
393- // System.out.println("TTM hideTipWindow2");
394398 enterTimer .stop ();
395399 exitTimer .stop ();
396400 }
@@ -645,6 +649,14 @@ private void checkForTipChange(MouseEvent event) {
645649 mouseEvent = event ;
646650 if ((newText == null || newText .equals (toolTipText ))
647651 && (newPreferredLocation == null || newPreferredLocation .equals (preferredLocation ))) {
652+
653+
654+ if (newText != null ) {
655+ enterTimer .restart ();
656+ return ;
657+ }
658+
659+
648660// if (tipWindow != null) {
649661// System.out.println("restarting insideTimer");
650662// insideTimer.restart();
You can’t perform that action at this time.
0 commit comments