Here you can find the source of isEmpty(JTextComponent component)
public static boolean isEmpty(JTextComponent component)
//package com.java2s; //License from project: Apache License import javax.swing.text.JTextComponent; public class Main { public static boolean isEmpty(JTextComponent component) { String content = component.getText(); return null == content || content.equals(""); }//from w w w. j a v a 2 s . c o m }