Package com.nexirius.framework.swing

Examples of com.nexirius.framework.swing.CFJRadioButton


            MyActionListener myActionListener = new MyActionListener(group);
            Insets margin = new Insets(0, 30, 0, 30);

            for (int i = 0; i < list.getSize(); ++i) {
                Object o = list.getElementAt(i);
                CFJRadioButton button = new CFJRadioButton(getFactory().getClientResource(), o.toString());

                button.setMargin(margin);
                group.add(button);

                if (!mustHide(i)) {
                    box.add(button);
                }

                buttons[i] = button;
                button.addActionListener(myActionListener);
            }

            setJComponent(box);
        } else if (getModel() instanceof BooleanModel) {
            ArrayLayout al = new ArrayLayout(true, ArrayLayout.FULL_SIZE);
            JPanel box = new JPanel(al);
            ButtonGroup group = new ButtonGroup();

            al.setMargin(0);
            buttons = new CFJRadioButton[2];
            MyBooleanListener myBooleanListener = new MyBooleanListener(group);
            SimpleArrayModel labelArray = ((BooleanModel) getModel()).getTrueFalseLabelModel();
            String labels[];

            if (labelArray == null) {
                labels = BooleanModel.TRUE_FALSE;
            } else {
                labels = new String[2];
                labels[0] = labelArray.getItem(0).toString();
                labels[1] = labelArray.getItem(1).toString();
            }

            buttons[0] = new CFJRadioButton(getFactory().getClientResource(), labels[0]);
            buttons[1] = new CFJRadioButton(getFactory().getClientResource(), labels[1]);
            group.add(buttons[0]);
            group.add(buttons[1]);

            if (swap) {
                box.add(buttons[0]);
View Full Code Here

TOP

Related Classes of com.nexirius.framework.swing.CFJRadioButton

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.