Fix that when you quickly move cursor from one hyperlink to another,

tooltip disappears.
This commit is contained in:
rkfg 2016-03-04 21:37:49 +03:00
parent 75324f778e
commit 79568c82f2

View file

@ -35,6 +35,7 @@ public class ColorPane extends JEditorPane {
HTMLEditorKit kit = new HTMLEditorKit();
HTMLDocument doc = new HTMLDocument();
private int tooltipDelay;
private int tooltipCounter;
public ColorPane() {
this.setEditorKit(kit);
@ -90,7 +91,8 @@ public class ColorPane extends JEditorPane {
if (location != null) {
container.setLocation(location);
}
container.setVisible(show);
tooltipCounter += show ? 1 : -1;
container.setVisible(tooltipCounter > 0);
c.repaint();
}
});