src/java.desktop/share/classes/java/awt/PopupMenu.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 151,161 ****
* has a non-<code>Component</code> parent
* @exception IllegalArgumentException if the origin is not in the
* parent's hierarchy
* @exception RuntimeException if the parent is not showing on screen
*/
- @SuppressWarnings("deprecation")
public void show(Component origin, int x, int y) {
// Use localParent for thread safety.
MenuContainer localParent = parent;
if (localParent == null) {
throw new NullPointerException("parent is null");
--- 151,160 ----
*** 175,185 ****
}
} else {
throw new IllegalArgumentException("origin not in parent's hierarchy");
}
}
! if (compParent.getPeer() == null || !compParent.isShowing()) {
throw new RuntimeException("parent not showing on screen");
}
if (peer == null) {
addNotify();
}
--- 174,184 ----
}
} else {
throw new IllegalArgumentException("origin not in parent's hierarchy");
}
}
! if (compParent.peer == null || !compParent.isShowing()) {
throw new RuntimeException("parent not showing on screen");
}
if (peer == null) {
addNotify();
}