File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/java.desktop/share/classes/javax/swing/table Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 1997, 2023 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1997, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -1360,9 +1360,12 @@ public boolean contains(Point p) {
1360
1360
}
1361
1361
1362
1362
public Point getLocationOnScreen () {
1363
- if (parent != null ) {
1363
+ if (parent != null && parent . isShowing () ) {
1364
1364
Point parentLocation = parent .getLocationOnScreen ();
1365
1365
Point componentLocation = getLocation ();
1366
+ if (parentLocation == null || componentLocation == null ) {
1367
+ return null ;
1368
+ }
1366
1369
componentLocation .translate (parentLocation .x , parentLocation .y );
1367
1370
return componentLocation ;
1368
1371
} else {
You can’t perform that action at this time.
0 commit comments