Example usage for java.awt.event ComponentEvent COMPONENT_SHOWN

List of usage examples for java.awt.event ComponentEvent COMPONENT_SHOWN

Introduction

In this page you can find the example usage for java.awt.event ComponentEvent COMPONENT_SHOWN.

Prototype

int COMPONENT_SHOWN

To view the source code for java.awt.event ComponentEvent COMPONENT_SHOWN.

Click Source Link

Document

This event indicates that the component was made visible.

Usage

From source file:Main.java

@Override
public void componentShown(ComponentEvent evt) {
    System.out.println(evt.getID() == ComponentEvent.COMPONENT_SHOWN);
}

From source file:EventTestPane.java

/** Display Component events. */
public void processComponentEvent(ComponentEvent e) {
    switch (e.getID()) {
    case ComponentEvent.COMPONENT_MOVED:
        showLine("COMPONENT_MOVED");
        break;//from  w ww .j a  va  2s .  co m
    case ComponentEvent.COMPONENT_RESIZED:
        showLine("COMPONENT_RESIZED");
        break;
    case ComponentEvent.COMPONENT_HIDDEN:
        showLine("COMPONENT_HIDDEN");
        break;
    case ComponentEvent.COMPONENT_SHOWN:
        showLine("COMPONENT_SHOWN");
        break;
    }
}

From source file:it.ventuland.ytd.ui.GUIClient.java

@Override
public void processComponentEvent(ComponentEvent e) {
    switch (e.getID()) {
    case ComponentEvent.COMPONENT_MOVED:
        break;/*from   w  ww. j av  a  2 s  .  c o m*/
    case ComponentEvent.COMPONENT_RESIZED:
        middlepane.setDividerLocation(middlepane.getWidth() / 3);
        break;
    case ComponentEvent.COMPONENT_HIDDEN:
        break;
    case ComponentEvent.COMPONENT_SHOWN:
        break;
    }
}

From source file:org.eclipse.jubula.rc.swing.listener.ComponentHandler.java

/**
 * {@inheritDoc}//  w w  w.j av  a  2 s . co  m
 */
public void eventDispatched(AWTEvent event) {

    final ClassLoader originalCL = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
    try {
        if (log.isDebugEnabled()) {
            log.debug(event.paramString());
        }
        final int id = event.getID();
        ComponentEvent componentEvent;
        switch (id) {
        case WindowEvent.WINDOW_ACTIVATED:
        case WindowEvent.WINDOW_OPENED:
            // add recursivly all components to AUTHierarchy 
            // and create names for unnamed components
            Window window = ((WindowEvent) event).getWindow();
            autHierarchy.add(window);
            break;
        case ContainerEvent.COMPONENT_ADDED:
            checkContainerListener((ContainerEvent) event);
            break;
        case ComponentEvent.COMPONENT_HIDDEN:
            componentEvent = (ComponentEvent) event;
            if (!hasListener(componentEvent.getComponent(), ComponentListener.class)) {
                autHierarchy.componentHidden(componentEvent);
            }
            break;
        case ComponentEvent.COMPONENT_SHOWN:
            componentEvent = (ComponentEvent) event;
            if (!hasListener(componentEvent.getComponent(), ComponentListener.class)) {
                autHierarchy.componentShown(componentEvent);
            }
            break;
        default:
            // do nothing
        }
        if (AUTServer.getInstance().getMode() == ChangeAUTModeMessage.OBJECT_MAPPING) {

            AUTServer.getInstance().updateHighLighter();
        }
    } catch (Throwable t) {
        log.error("exception during ComponentHandler", t); //$NON-NLS-1$
    } finally {
        Thread.currentThread().setContextClassLoader(originalCL);
    }
}

From source file:zsk.JFCMainClient.java

public void processComponentEvent(ComponentEvent e) {
    switch (e.getID()) {
    case ComponentEvent.COMPONENT_MOVED:
        break;/*from ww w  .  j av  a 2 s . co m*/
    case ComponentEvent.COMPONENT_RESIZED:
        JFCMainClient.frame.middlepane.setDividerLocation(JFCMainClient.frame.middlepane.getWidth() / 3);
        break;
    case ComponentEvent.COMPONENT_HIDDEN:
        break;
    case ComponentEvent.COMPONENT_SHOWN:
        break;
    }
}