/** * Creates and returns a button that is bound to the given Action. * This is a hook that allows to return customized buttons. * For example, the JGoodies {@code JGButton} configures * the accessible name and accessible description from Actions * that provide these information.<p> * * This default implementation delegates the button creation to this * builder's component factory, if it is an an instance of ComponentFactory * (that provides {@link ComponentFactory2#createButton(Action)}). * Otherwise a JButton is created. * * @param action provides bound visual properties for the button * @return the created button * * @since 1.4 */ private JButton createButton(Action action) { if (getComponentFactory() instanceof ComponentFactory2) { return ((ComponentFactory2) getComponentFactory()).createButton(action); } return new JButton(action); }