< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * 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,11 +231,11 @@
      * 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("")) {
+        if (s.isEmpty()) {
             return null;
         }
         Graphics g = getGraphics();
         if (g == null) {
             return null;

@@ -258,11 +258,11 @@
      * 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("")) {
+        if (s.isEmpty()) {
             return;
         }
         g.setFont(getTargetFont());
         FontMetrics fm = g.getFontMetrics();
         String str = getTargetLabel();
< prev index next >