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 11/*
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.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -1360,9 +1360,12 @@ public boolean contains(Point p) {
13601360 }
13611361
13621362 public Point getLocationOnScreen () {
1363- if (parent != null ) {
1363+ if (parent != null && parent . isShowing () ) {
13641364 Point parentLocation = parent .getLocationOnScreen ();
13651365 Point componentLocation = getLocation ();
1366+ if (parentLocation == null || componentLocation == null ) {
1367+ return null ;
1368+ }
13661369 componentLocation .translate (parentLocation .x , parentLocation .y );
13671370 return componentLocation ;
13681371 } else {
You can’t perform that action at this time.
0 commit comments