Java JComponent Properties isComponentShowing(final JComponent component)

Here you can find the source of isComponentShowing(final JComponent component)

Description

A convenience method to centralise all isShowing() calls.

License

Open Source License

Parameter

Parameter Description
component a parameter

Return

boolean

Declaration


public static boolean isComponentShowing(final JComponent component) 

Method Source Code


//package com.java2s;
// it under the terms of the GNU General Public License as published by

import javax.swing.*;

public class Main {
    /***********************************************************************************************
     * A convenience method to centralise all isShowing() calls.
     *//from   w  w w .ja v  a 2s  . c om
     * @param component
     *
     * @return boolean
     */

    public static boolean isComponentShowing(final JComponent component) {
        // The API semantics for "shown" are different from for "visible".
        // Component.isShowing() means the component is truly visible,
        // whereas Component.isVisible() does not.
        // See: http://forums.sun.com/thread.jspa?messageID=848376

        if (component != null) {
            //System.out.println("UIComponent SHOWING=" + component.isShowing());
            return (component.isShowing());
        } else {
            //System.out.println("UIComponent SHOWING=false");
            return (false);
        }
    }
}

Related

  1. getProperties(JComponent component)
  2. getProperties(JComponent component)
  3. getVisibleBoundsOnScreen(JComponent component)
  4. invert(JComponent c)
  5. isActive(JComponent c)
  6. isHorizontallyVisible(JComponent c, int from, int to)
  7. isMandatory(JComponent comp)
  8. isMarker(JComponent component)
  9. isOver(JComponent c)