Java Utililty Methods JButton

List of utility methods to do JButton

Description

The list of methods to do JButton are organized into topic(s).

Method

voidformatButtonAsLabel(JButton button)
Formats a JButton as a JLabel.
button.setFocusPainted(false);
button.setMargin(new Insets(0, 0, 0, 0));
button.setContentAreaFilled(false);
button.setBorderPainted(false);
button.setOpaque(false);
voidformatJButton(JButton button, String tooltips)
format J Button
button.setToolTipText(tooltips);
intgetButtonNumber(JButton btn)
Takes number from button name.
int value = -1;
String svalue = btn.getText();
try {
    value = Integer.parseInt(svalue);
} catch (NumberFormatException nfe) {
return value;
voidgetScrollStroke(final JButton _jlbl_stroke)
Apply stroke on background.
final int strokeDistance = 10;
if (_jlbl_stroke.getWidth() > 0 && _jlbl_stroke.getHeight() > 0) {
    BufferedImage bi_stroke = new BufferedImage(_jlbl_stroke.getWidth(), _jlbl_stroke.getHeight(),
            BufferedImage.TYPE_INT_ARGB);
    for (int x = 0; x < bi_stroke.getWidth(); x++) {
        for (int y = 0; y < bi_stroke.getHeight(); y++) {
            try {
                if ((x + _jlbl_stroke.getLocationOnScreen().x - y - _jlbl_stroke.getLocationOnScreen().y)
...
JButtongetWFStep(Vector actionButtons, String action)
get WF Step
for (int i = 0; i < actionButtons.size(); i++) {
    JButton button = actionButtons.elementAt(i);
    String[] cmnd = button.getActionCommand().split("=");
    String stepAction = cmnd[1];
    if (stepAction.equals(action))
        return button;
return null;
...
voidinitHelpButton(final JButton buttonHelp)
init Help Button
buttonHelp.setMnemonic(KeyEvent.VK_H);
buttonHelp.setDefaultCapable(false);
StringnombreImg(JButton boton)
nombre Img
return boton.getIcon().toString().split(".jpg")[0];
voidnormalizeComponentDimension(JComponent[] jButtonList)
Normalization of the size for all JComponent.
normalizeComponentDimension(jButtonList, null);
voidnullifyButtonUI(final JButton button)
Nullifies button styles
button.setUI(new BasicButtonUI());
button.setMargin(new Insets(0, 0, 0, 0));
button.setBorder(null);
button.setBorderPainted(false);
button.setContentAreaFilled(false);
button.setFocusable(false);
button.setOpaque(false);
ListorderOKCancelButtons(JButton okButton, JButton cancelButton)
order OK Cancel Buttons
List result = new ArrayList();
if (isMacOSX()) {
    result.add(cancelButton);
    result.add(okButton);
} else {
    result.add(okButton);
    result.add(cancelButton);
return result;