< prev index next >

src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2008, 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

@@ -254,19 +254,19 @@
             iconSize.width = icon.getIconWidth();
             iconSize.height = icon.getIconHeight();
         }
 
         // accRect
-        if (!accText.equals("")) {
+        if (!accText.isEmpty()) {
             accSize.width = SwingUtilities2.stringWidth(mi, accFm, accText);
             accSize.height = accFm.getHeight();
         }
 
         // textRect
         if (text == null) {
             text = "";
-        } else if (!text.equals("")) {
+        } else if (!text.isEmpty()) {
             if (htmlView != null) {
                 // Text is HTML
                 textSize.width =
                         (int) htmlView.getPreferredSpan(View.X_AXIS);
                 textSize.height =
< prev index next >