Java JComboBox isComboBoxButton(AbstractButton button)

Here you can find the source of isComboBoxButton(AbstractButton button)

Description

Checks and answers if the specified button is in a combo box.

License

Open Source License

Parameter

Parameter Description
button the button to check

Return

true if in combo box, false otherwise

Declaration

public static boolean isComboBoxButton(AbstractButton button) 

Method Source Code

//package com.java2s;
import java.awt.*;

import javax.swing.*;

public class Main {
    /**/*from w  w w  . j  a  va2  s .c o m*/
     * Checks and answers if the specified button is in a combo box.
     * 
     * @param button
     *            the button to check
     * @return <code>true</code> if in combo box, <code>false</code> otherwise
     */
    public static boolean isComboBoxButton(AbstractButton button) {
        Container parent = button.getParent();
        return (parent != null)
                && ((parent instanceof JComboBox) || (parent.getParent() instanceof JComboBox));
    }
}

Related

  1. getPrinterJComboBox()
  2. getScrollBarWidth(JComboBox comboBox, JScrollPane scrollPane)
  3. initCombo(JComboBox combo)
  4. inputComboBox(JComboBox cbx, String[] str)
  5. isCbEquals(JComboBox cb, String str)
  6. isEmptyStr(javax.swing.JComboBox input)
  7. isJComboBoxNotEmpty(javax.swing.JComboBox combo)
  8. largeThan(javax.swing.JComboBox input, double x)
  9. loadComboBox(JComboBox combo, List list)