mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
PopupFactory: fixed occasional NullPointerException in FlatPopupFactory.fixToolTipLocation() (issue #305)
This commit is contained in:
@@ -23,6 +23,8 @@ FlatLaf Change Log
|
||||
LaF.
|
||||
- On HiDPI screens, use high-resolution images for preview of iconified
|
||||
internal frames in dock.
|
||||
- PopupFactory: Fixed occasional `NullPointerException` in
|
||||
`FlatPopupFactory.fixToolTipLocation()`. (issue #305)
|
||||
|
||||
|
||||
## 1.1.2
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.awt.Insets;
|
||||
import java.awt.MouseInfo;
|
||||
import java.awt.Panel;
|
||||
import java.awt.Point;
|
||||
import java.awt.PointerInfo;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ComponentEvent;
|
||||
@@ -216,7 +217,11 @@ public class FlatPopupFactory
|
||||
if( !(contents instanceof JToolTip) || !wasInvokedFromToolTipManager() )
|
||||
return null;
|
||||
|
||||
Point mouseLocation = MouseInfo.getPointerInfo().getLocation();
|
||||
PointerInfo pointerInfo = MouseInfo.getPointerInfo();
|
||||
if( pointerInfo == null )
|
||||
return null;
|
||||
|
||||
Point mouseLocation = pointerInfo.getLocation();
|
||||
Dimension tipSize = contents.getPreferredSize();
|
||||
|
||||
// check whether mouse location is within tooltip bounds
|
||||
|
||||
Reference in New Issue
Block a user