< prev index next >
src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2002, 2018, 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) 2002, 2019, 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
*** 231,241 ****
* Returns height of menu window's caption.
* Can be overriden for popup menus and tear-off menus
*/
protected Dimension getCaptionSize() {
String s = getTargetLabel();
! if (s.equals("")) {
return null;
}
Graphics g = getGraphics();
if (g == null) {
return null;
--- 231,241 ----
* Returns height of menu window's caption.
* Can be overriden for popup menus and tear-off menus
*/
protected Dimension getCaptionSize() {
String s = getTargetLabel();
! if (s.isEmpty()) {
return null;
}
Graphics g = getGraphics();
if (g == null) {
return null;
*** 258,268 ****
* Can be overriden for popup menus and tear-off menus.
* Default implementation does nothing
*/
protected void paintCaption(Graphics g, Rectangle rect) {
String s = getTargetLabel();
! if (s.equals("")) {
return;
}
g.setFont(getTargetFont());
FontMetrics fm = g.getFontMetrics();
String str = getTargetLabel();
--- 258,268 ----
* Can be overriden for popup menus and tear-off menus.
* Default implementation does nothing
*/
protected void paintCaption(Graphics g, Rectangle rect) {
String s = getTargetLabel();
! if (s.isEmpty()) {
return;
}
g.setFont(getTargetFont());
FontMetrics fm = g.getFontMetrics();
String str = getTargetLabel();
< prev index next >