Here you can find the source of hasText(AbstractButton button)
Parameter | Description |
---|---|
button | Button. |
true
is returned, otherwise false
.
public static boolean hasText(AbstractButton button)
//package com.java2s; import javax.swing.*; public class Main { /**// w w w.j av a 2s . co m * Checks whether the specified button has associated text. * * @param button * Button. * @return If the button has associated text, <code>true</code> is returned, * otherwise <code>false</code>. */ public static boolean hasText(AbstractButton button) { String text = button.getText(); if ((text != null) && (text.length() > 0)) { return true; } return false; } }