< prev index next >
src/java.desktop/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2002, 2016, 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
@@ -193,11 +193,11 @@
throw new IllegalArgumentException(
"Width and height must be >= 0");
}
AbstractButton b = (AbstractButton)c;
String text = b.getText();
- if (text == null || "".equals(text)) {
+ if (text == null || text.isEmpty()) {
return -1;
}
Insets i = b.getInsets();
Rectangle viewRect = new Rectangle();
Rectangle textRect = new Rectangle();
< prev index next >