Java JComponent Properties isRequired(JComponent component)

Here you can find the source of isRequired(JComponent component)

Description

Determines if the supplied field is required.

License

Open Source License

Parameter

Parameter Description
component The component.

Return

true if required, false otherwise.

Declaration

public static boolean isRequired(JComponent component) 

Method Source Code

//package com.java2s;
/**/*from   w ww  .ja v  a2  s . c o  m*/
 * Formic installer framework.
 * Copyright (C) 2005 - 2008 Eric Van Dewoestine
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

import javax.swing.JComponent;

public class Main {
    private static final String REQUIRED = "required";

    /**
     * Determines if the supplied field is required.
     *
     * @param component The component.
     * @return true if required, false otherwise.
     */
    public static boolean isRequired(JComponent component) {
        Boolean bool = (Boolean) component.getClientProperty(REQUIRED);
        return bool != null ? bool.booleanValue() : false;
    }
}

Related

  1. isMarker(JComponent component)
  2. isOver(JComponent c)
  3. isOverlapping(JComponent comp1, JComponent comp2)
  4. isPasteEnabled(JComponent component)
  5. isRectangularSelection(JComponent c)
  6. isVisible(JComponent c, Rectangle r)
  7. isVisible(JComponent comp)
  8. isVisibleOnScreen(final JComponent component)
  9. registerComponent(JComponent c)