Java JButton Settings findButtonComponents(Container container, String label)

Here you can find the source of findButtonComponents(Container container, String label)

Description

find Button Components

License

LGPL

Declaration

public static JButton findButtonComponents(Container container, String label) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.awt.Component;
import java.awt.Container;

import javax.swing.JButton;

public class Main {
    public static JButton findButtonComponents(Container container, String label) {
        for (Component c : container.getComponents()) {
            if (c instanceof JButton) {
                final JButton button = (JButton) c;

                if (button.getText().equalsIgnoreCase(label))
                    return button;
            }//from   w w  w  .j  av a 2 s.  co m
        }

        return null;
    }
}

Related

  1. drawDefaultButtonBorder(Graphics g, int x, int y, int w, int h, boolean active)
  2. emphasizeButton(AbstractButton btn)
  3. equalizeButtonSizes(JPanel jPanelButtons)
  4. filterMnemonic(final String s, final AbstractButton b)
  5. findButton(Container container, String text)
  6. findDescendantButtonWithText(Container root, String desiredText)
  7. fixButtonUI(AbstractButton button)
  8. formatButtonFromAction(Action a)
  9. getAbstractButton(Container owner, String text)