List of utility methods to do JButton Create
JButton | createJButton(final String label, final Font font) Creates a JButton . final JButton result = new JButton(label); result.setFont(font); return result; |
JButton | createJButton(String label, Font font) Creates a JButton . JButton result = new JButton(label); result.setFont(font); return result; |
JButton | createJButton(String text, String name, ActionListener a) Creates a JButton with a given text, a given name and a given ActionListener. JButton jb = new JButton(text); jb.setName(name); jb.addActionListener(a); return jb; |
JLabel | createLabelButton(String text) create Label Button JLabel b = new JLabel(text); b.setCursor(new Cursor(Cursor.HAND_CURSOR)); return b; |
JButton | createListButton(Action action) create List Button JButton btnButton = new JButton(action); btnButton.setToolTipText(btnButton.getText()); btnButton.setText(""); btnButton.setBorderPainted(false); btnButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); btnButton.setFocusable(false); btnButton.setHorizontalAlignment(SwingConstants.LEFT); return btnButton; ... |
JButton | createNoURLGraphicalButton(String imageName, String alternateText) Creates a JButton using imageName, or if imageName is unavailable, use alternateText return new JButton(alternateText, new ImageIcon(imageName)); |
JPanel | createOkCancelPanel(final JButton okBtn, final JButton cancelBtn) create Ok Cancel Panel return createOkCancelPanel(okBtn, cancelBtn, new JButton[0]); |
void | CreateOptionButtonGroup(Box boxGeneric, Border bdrButtonGroup, String[] elements, String[] commandActions, Dimension elementDimension) Create Option Button Group ButtonGroup group = new ButtonGroup(); JRadioButton optElement; int i = 0; boxGeneric.setBorder(bdrButtonGroup); for (String iterElement : elements) { optElement = new JRadioButton(iterElement); optElement.setActionCommand(commandActions[i]); if (elementDimension != null) { ... |
JRadioButton | createRadioButton(JComponent parent, String text) Creates and returns a radio button with the given text. JRadioButton button = new JRadioButton(); button.setText(text); parent.add(button); return button; |
JRadioButton | createRadioButton(String name, String command, boolean isSelected, ActionListener listener) Creates a radio button with all the properties set up front. JRadioButton button; button = new JRadioButton(name); button.setActionCommand(command); button.setSelected(isSelected); button.addActionListener(listener); return button; |