Here you can find the source of newButtonsFrom(Collection
public static Collection<JButton> newButtonsFrom(Collection<AbstractAction> action)
//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; } }