Example usage for java.awt Component isValid

List of usage examples for java.awt Component isValid

Introduction

In this page you can find the example usage for java.awt Component isValid.

Prototype

public boolean isValid() 

Source Link

Document

Determines whether this component is valid.

Usage

From source file:Main.java

public static String formateComponentInfosToPrint(Component comp) {
    StringBuilder buf = new StringBuilder();
    buf.append(comp.getClass().getSimpleName());
    buf.append(" [");
    buf.append(comp.getName());/*  w w w .  j a  v a2  s  . c o  m*/
    if (comp instanceof JLabel)
        buf.append(",\"").append(((JLabel) comp).getText()).append("\"");
    buf.append(",");
    buf.append(comp.getClass().getName());
    buf.append(",");
    buf.append(comp.isVisible() ? "visible" : "not visible");
    buf.append(",");
    buf.append(comp.isValid() ? "valid" : "invalid");
    buf.append("]");
    return buf.toString();
}