Package javax.swing

Examples of javax.swing.ButtonModel


        }
        return buttons.toArray(new AbstractButton[buttons.size()]);
    }

    private int getSelectedIndex() {
        final ButtonModel selectedModel = buttonGroup.getSelection();
        final Component children[] = getButtonComponents();
        for (int i = 0; i < children.length; i++) {
            AbstractButton button = (AbstractButton) children[i];
            if (button.getModel() == selectedModel) {
                return i;
View Full Code Here


        }
        previousPressTime = event.getWhen();
    }

    public void mouseExited(final MouseEvent event) {
        final ButtonModel model = button.getModel();
        if (model.isEnabled()) {
            if (button.isRolloverEnabled()) {
                model.setRollover(false);
            }
            model.setArmed(false);
        }
    }
View Full Code Here

            model.setArmed(false);
        }
    }

    public void mouseEntered(final MouseEvent event) {
        final ButtonModel model = button.getModel();
        if (button.isRolloverEnabled()) {
            model.setRollover(true);
        }
        if (model.isEnabled() && model.isPressed()) {
            model.setArmed(true);
        }
    }
View Full Code Here

    protected void checkOpacity(final AbstractButton button) {
    }

    public void focusLost(final FocusEvent event) {
        if (button.isEnabled()) {
            final ButtonModel model = button.getModel();
            if (model.isEnabled()) {
                model.setArmed(false);
                model.setPressed(false);
            }
            button.repaint();
        }
    }
View Full Code Here

public class BasicButtonListener implements MouseListener, MouseMotionListener, FocusListener, ChangeListener, PropertyChangeListener {

    private static final class PressButtonAction extends AbstractAction {
        public static void press(final AbstractButton button) {
            if (button.isEnabled()) {
                final ButtonModel model = button.getModel();
                model.setArmed(true);
                model.setPressed(true);
                button.requestFocusInWindow();
            }
        }
View Full Code Here

    };

    private static final class ReleaseButtonAction extends AbstractAction {
        public static void release(final AbstractButton button) {
            if (button.isEnabled()) {
                final ButtonModel model = button.getModel();
                model.setPressed(false);
                model.setArmed(false);
            }
        }
View Full Code Here

     */
    @Override
    public void setText(String resourcename) {
        Enumeration<AbstractButton> en = this.bGroup.getElements();
        while (en.hasMoreElements()) {
            ButtonModel model = en.nextElement().getModel();
            if (model.getActionCommand().equals(resourcename)) {
                this.bGroup.setSelected(model, true);
            } else {
                this.bGroup.setSelected(model, false);
            }
        }
View Full Code Here

        }

        public static Component createInputButtonComponent(final Object model,
                final AttributeSet attrs) {

            ButtonModel buttonModel = (ButtonModel) model;
            final JButton button = new JButton("");

            // Model
            if (buttonModel == null) {
                buttonModel = new FormButtonModel(new Form(SimpleAttributeSet.EMPTY),
View Full Code Here

        }

        public static Component createInputResetComponent(final Object model,
                                                     final AttributeSet attrs,
                                                     final FormView view) {
            ButtonModel resetButtonModel = (ButtonModel) model;
            final JButton resetButton = new JButton();

            // Model
            if (resetButtonModel == null) {
                resetButtonModel = new FormButtonModel(new Form(SimpleAttributeSet.EMPTY),
View Full Code Here

        }

        public static Component createInputSubmitComponent(final Object model,
                                                       final AttributeSet attrs,
                                                       final FormView view) {
            ButtonModel submitButtonModel = (ButtonModel) model;
            final JButton submitButton = new JButton();

            // Model
            if (submitButtonModel == null) {
                submitButtonModel = new FormButtonModel(new Form(SimpleAttributeSet.EMPTY),
View Full Code Here

TOP

Related Classes of javax.swing.ButtonModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.