diff options
Diffstat (limited to 'javax/swing/JMenuItem.java')
-rw-r--r-- | javax/swing/JMenuItem.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/javax/swing/JMenuItem.java b/javax/swing/JMenuItem.java index f7f93bf00..324d61cd4 100644 --- a/javax/swing/JMenuItem.java +++ b/javax/swing/JMenuItem.java @@ -833,4 +833,20 @@ public class JMenuItem extends AbstractButton implements Accessible, return AccessibleRole.MENU_ITEM; } } + + /** + * Returns <code>true</code> if the component is guaranteed to be painted + * on top of others. This returns false by default and is overridden by + * components like JMenuItem, JPopupMenu and JToolTip to return true for + * added efficiency. + * + * @return <code>true</code> if the component is guaranteed to be painted + * on top of others + */ + boolean onTop() + { + return SwingUtilities.getAncestorOfClass(JInternalFrame.class, this) + == null; + } + } |