Java JButton Create newButtonsFrom(Collection action)

Here you can find the source of newButtonsFrom(Collection action)

Description

new Buttons From

License

Apache License

Declaration

public static Collection<JButton> newButtonsFrom(Collection<AbstractAction> action) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.util.ArrayList;
import java.util.Collection;

import javax.swing.AbstractAction;

import javax.swing.JButton;

public class Main {
    public static Collection<JButton> newButtonsFrom(Collection<AbstractAction> action) {

        Collection<JButton> buttons = new ArrayList<JButton>();

        for (AbstractAction a : action) {
            buttons.add(new JButton(a));
        }/*from   w  ww. ja  v a2 s. c  o m*/
        return buttons;
    }
}

Related

  1. makeRadioButton(String text, String actionCommand, ButtonGroup buttonGroup, boolean selected)
  2. makeToggleButton(final Object owner, final String id, final String altText, final int wpad, final int hpad)
  3. newButton(String name, String text)
  4. newButton(String text, ActionListener... listeners)
  5. newButtonPopup(final JToggleButton button)
  6. newJButton()
  7. newJButton(String name, String tooltip, ActionListener al)