Here you can find the source of isComboBoxButton(AbstractButton button)
Parameter | Description |
---|---|
button | the button to check |
true
if in combo box, false
otherwise
public static boolean isComboBoxButton(AbstractButton button)
//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)); } }