Here you can find the source of hideChildButtonsWithTooltip(Container parent, String tooltip)
Parameter | Description |
---|---|
parent | a parameter |
tooltip | a parameter |
private static void hideChildButtonsWithTooltip(Container parent, String tooltip)
//package com.java2s; //License from project: GNU General Public License import java.awt.Component; import java.awt.Container; import javax.swing.AbstractButton; public class Main { /**/*from w ww . j a v a 2 s .c o m*/ * Find button by tooltip * * @param parent * @param tooltip */ private static void hideChildButtonsWithTooltip(Container parent, String tooltip) { for (Component component : parent.getComponents()) { if (component instanceof AbstractButton && tooltip.equals(((AbstractButton) component).getToolTipText())) { component.setVisible(false); // hide this } else if (component instanceof Container) { hideChildButtonsWithTooltip((Container) component, tooltip); } } } }