Example usage for javax.swing JComponent getParent

List of usage examples for javax.swing JComponent getParent

Introduction

In this page you can find the example usage for javax.swing JComponent getParent.

Prototype

public Container getParent() 

Source Link

Document

Gets the parent of this component.

Usage

From source file:net.sourceforge.squirrel_sql.fw.gui.debug.DebugEventListener.java

private void printDebugInfo(JComponent source, AWTEvent event) {
    Container parent = source.getParent();
    String sourceName = source.getName();
    String sourceClassName = source.getClass().toString();
    String parentName = parent == null ? null : parent.getName();
    String parentClassName = parent == null ? null : parent.getClass().toString();

    StringBuilder msg = new StringBuilder(getEventMessagePrefix(event));
    msg.append("\n");
    msg.append("\t sourceName:").append(sourceName).append("\n");
    msg.append("\t sourceClassName:").append(sourceClassName).append("\n");
    msg.append("\t parentName:").append(parentName).append("\n");
    msg.append("\t parentClassName:").append(parentClassName);
    System.out.println(msg.toString());
}