List of utility methods to do JButton
void | formatButtonAsLabel(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);
|
void | formatJButton(JButton button, String tooltips) format J Button button.setToolTipText(tooltips); |
int | getButtonNumber(JButton btn) Takes number from button name. int value = -1; String svalue = btn.getText(); try { value = Integer.parseInt(svalue); } catch (NumberFormatException nfe) { return value; |
void | getScrollStroke(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) ... |
JButton | getWFStep(Vector 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; ... |
void | initHelpButton(final JButton buttonHelp) init Help Button buttonHelp.setMnemonic(KeyEvent.VK_H); buttonHelp.setDefaultCapable(false); |
String | nombreImg(JButton boton) nombre Img return boton.getIcon().toString().split(".jpg")[0]; |
void | normalizeComponentDimension(JComponent[] jButtonList) Normalization of the size for all JComponent. normalizeComponentDimension(jButtonList, null); |
void | nullifyButtonUI(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); |
List | orderOKCancelButtons(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; |