The list of methods to do JButton Create are organized into topic(s).
JButton
button(String name) button
JButton ret = nameComponent(new JButton(), name);
ret.setBorderPainted(false);
ret.setFocusable(false);
return ret;
JPanel
createAddRemoveButtonPanel(Action addAction, Icon addIcon, String addToolTip, Action removeAction, Icon removeIcon, String removeToolTip, int axis) create Add Remove Button Panel
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new BoxLayout(buttonPanel, axis));
buttonPanel.setOpaque(false);
JButton addButton = new JButton(addAction);
if (addIcon != null) {
addButton.setIcon(addIcon);
addButton.setText(null);
addButton.setToolTipText(addToolTip);
addButton.putClientProperty("JButton.buttonType", "toolbar");
addButton.setOpaque(false);
addAction.setEnabled(false);
JButton removeButton = new JButton(removeAction);
if (removeIcon != null) {
removeButton.setIcon(removeIcon);
removeButton.setText(null);
removeButton.setToolTipText(removeToolTip);
removeButton.putClientProperty("JButton.buttonType", "toolbar");
removeButton.setOpaque(false);
removeAction.setEnabled(false);
buttonPanel.add(addButton);
buttonPanel.add(new JToolBar.Separator(new Dimension(6, 6)));
buttonPanel.add(removeButton);
return buttonPanel;
JButton
createButton(Action action) create Button
JButton button = new JButton(action);
button.setMargin(new Insets(0, 0, 0, 0));
button.setText(null);
button.setFocusable(false);
KeyStroke keyStroke = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY);
if (keyStroke != null) {
InputMap inputMap = button.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
inputMap.put(keyStroke, Action.ACCELERATOR_KEY);
...
JButton
createButton(Action action) create Button
JButton button = new JButton(action);
setButtonSize(button, buttonPrefSize);
return button;