Package javax.swing

Examples of javax.swing.ButtonGroup


        printerPanel.carriageReturn();
       
        // Selection
        printAllButton = resources.getRadioButton("printAll", null);
        printSelectedButton = resources.getRadioButton("printSelected", null);
        ButtonGroup printButtonGroup = new ButtonGroup();
        printButtonGroup.add(printAllButton);
        printButtonGroup.add(printSelectedButton);

        selectionPanel.addOnCurrentRow(printAllButton);
        selectionPanel.carriageReturn();
        selectionPanel.addOnCurrentRow(printSelectedButton);
        selectionPanel.carriageReturn();


        // Number of copies    
        JLabel lnbCopies = resources.getLabel("nbCopies");
        SpinnerNumberModel spiNbCopies = new SpinnerNumberModel();

        spiNbCopies.setStepSize(new Integer(1));
        spiNbCopies.setMinimum(new Integer(1));
        spiNbCopies.setMaximum(new Integer(100));
        spiNbCopies.setValue(new Integer(1));
        nbCopies = new JSpinner(spiNbCopies);

        copiesPanel.addOnCurrentRow(lnbCopies);
        copiesPanel.addOnCurrentRow(nbCopies, 1, true, false, true);
        copiesPanel.carriageReturn();


        // Paper size     
        paperNameList = new JComboBox(paperNames);
        paperNameList.setSelectedIndex(0);
       
        JLabel lpaper =  resources.getLabel("paper");
        paperSizePanel.addOnCurrentRow(lpaper);
        paperSizePanel.addOnCurrentRow(paperNameList,1, true, false, true);
        paperSizePanel.addOnCurrentRow( cbzoom = resources.getCheckBox("updateToPaper", null), 2, false, false, true);
        cbzoom.setSelected(true);
       
       
        // Orientation
        portraitButton = resources.getRadioButton("portraitOrientation", null);
        landscapeButton = resources.getRadioButton("landscapeOrientation", null);
        reverseLandscapeButton = resources.getRadioButton("reverseLandscapeOrientation", null);

        ButtonGroup paperOrientationGroup = new ButtonGroup();
        paperOrientationGroup.add(portraitButton);
        paperOrientationGroup.add(landscapeButton);
        paperOrientationGroup.add(reverseLandscapeButton);
        portraitButton.setSelected(true);
        landscapeButton.setSelected(false);
        reverseLandscapeButton.setSelected(false);
       
        paperOrientationPanel.addOnCurrentRow(portraitButton);
View Full Code Here


     capacity_k_bit_s_radiobox = new JRadioButton();
     capacity_k_byte_s_radiobox = new JRadioButton();
     ok_button = new JButton();
     cancel_button = new JButton();
     apply_button = new JButton();
     button_group = new ButtonGroup();
    
     init()
    
     // set the values from SettingsManager
     setInitData();
View Full Code Here

            dstree = FilteredSourceTree.getFromPool("PlotGridShapesTemplatePanel");
           
            rPlot = new JRadioButton(resources.getString("plot"), false);
            rTimePlot = new JRadioButton(resources.getString("timePlot"), false);
            ButtonGroup bg = new ButtonGroup();
            bg.add(rPlot);
            bg.add(rTimePlot);
            rTimePlot.setSelected(isTimePlot);
            rPlot.setSelected(!isTimePlot);
           
           
            cbDefaultPrimaryXds = new JCheckBox(resources.getString("defaultPrimaryXds"), (defaultPrimaryXDataSource != null));
View Full Code Here

       
        /** The current selected shape creator. Null if the arrow button is selected  */
        ShapeCreator currentShapeCreator;

        public ShapesToolBar(){
            group = new ButtonGroup();
            shapeButtons = new ArrayList();
           
            currentShapeCreator = null;
            setFloatable(false);
           
View Full Code Here

            box = Box.createHorizontalBox();
            box.add(rbDynamic = new JRadioButton(resources.getString("dynamic"),false));
            box.add(Box.createHorizontalGlue());
            add(box);
           
            ButtonGroup bg = new ButtonGroup();
            bg.add(rbStatic);
            bg.add(rbDynamic);
           
            final JPanel cardPane = new JPanel(new CardLayout());
           
            box = Box.createHorizontalBox();
            box.add(bufferLabel = new JLabel(resources.getString("staticBufferLabel")));
View Full Code Here

        cbxformat.addItem(resources.getString("Octal"));
        cbxformat.addItem(resources.getString("Binary"));
        cbxformat.setEditable(false);
        options.add(box);
       
        ButtonGroup bg = new ButtonGroup();
        bg.add(rbFixedText);
        bg.add(rbUseSource);

        box = Box.createHorizontalBox();
        box.add(lformatdigits = new JLabel(resources.getString("DecimalDigits")));
        box.add(Box.createHorizontalGlue());
        box.add(nfformat = new NumberField(3,3));
        nfformat.setColumns(3);
        nfformat.setHorizontalAlignment(JTextField.RIGHT);

        cbxformat.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            currentAction.option = new Object[] { new Integer(cbxformat.getSelectedIndex()) };
            setActionProperties();
          }
        });

        options.add(box);

        JPanel textOptions = new JPanel(new BorderLayout());
        textOptions.add(options, BorderLayout.NORTH);
        optionPanel.add(textOptions, "text");
       
        // ---------- Move options -----------

        options = Box.createVerticalBox();
        options.add(Box.createVerticalGlue());

        Box descPanel = Box.createHorizontalBox();
        descPanel.add(new JLabel(resources.getString("WhenReachingAnArrayEdge")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);

        descPanel = Box.createHorizontalBox();
        descPanel.add(rbDoNothing = new JRadioButton(resources.getString("DoNothing")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);
       
        descPanel = Box.createHorizontalBox();
        descPanel.add(rbWrap = new JRadioButton(resources.getString("WrapToOtherSide")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);

        descPanel = Box.createHorizontalBox();
        descPanel.add(rbExtend = new JRadioButton(resources.getString("ExtendArray")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);

        options.add(Box.createVerticalGlue());

        rbDoNothing.addChangeListener(new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            if (rbDoNothing.isSelected()) {
              currentAction.option = AutomatonAction.OPTION_DO_NOTHING;
              setActionProperties();
            }
          }
        });

        rbWrap.addChangeListener(new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            if (rbWrap.isSelected()) {
              currentAction.option = AutomatonAction.OPTION_WRAP;
              setActionProperties();
            }
          }
        });

        rbExtend.addChangeListener(new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            if (rbExtend.isSelected()) {
              currentAction.option = AutomatonAction.OPTION_EXTEND;
              setActionProperties();
            }
          }
        });
       
       
        bg = new ButtonGroup();
        bg.add(rbDoNothing);
        bg.add(rbWrap);
        bg.add(rbExtend);

        JPanel moveOptions = new JPanel(new BorderLayout());
        moveOptions.add(options, BorderLayout.CENTER);
       
        optionPanel.add(moveOptions, "move");
View Full Code Here

        if (enableCloseAll) {
            _menu.add(_miCloseAll = _resources.getItem("closeAll", this));
            _menu.add(new JSeparator());
        }

        _bgComponents = new ButtonGroup();
        setComponentsMenuItems();

        return _menu;
    }
View Full Code Here

        Enumeration e = _bgComponents.getElements();
        while (e.hasMoreElements()) {
            JMenuItem mi = (JMenuItem) e.nextElement();
            _menu.remove(mi);
        }
        _bgComponents = new ButtonGroup();

        // add new ones
        for (int i = 0; i < _components.size(); i++) {
            ComponentRadioButton crb = new ComponentRadioButton(
                    (JComponent) _components.elementAt(i));
View Full Code Here

            public void stateChanged(ChangeEvent e) {
                lpoints.setEnabled(rbUser.isSelected());
                taPoints.setEnabled(rbUser.isSelected());
            }
        };
        ButtonGroup bg = new ButtonGroup();
        bg.add(rbRegular);
        bg.add(rbUser);
        lpoints = new JLabel(resources.getString("CouplesOfX,YPoints:"));
        taPoints = new JTextArea();
        taPoints.setText("");
        taPoints.setRows(5);
        JScrollPane jsptaPoints = new JScrollPane(taPoints);
View Full Code Here

        normalView = resources.getRadioButton("layoutMode", this);
        printView = resources.getRadioButton("pageMode", this);
        normalView.setSelected(false);
        printView.setSelected(false);
       
        ButtonGroup modeGroup = new ButtonGroup();
        modeGroup.add(normalView);
        modeGroup.add(printView);

        pageModePanel.addOnCurrentRow(normalView);
        pageModePanel.carriageReturn();
        pageModePanel.addOnCurrentRow(printView);
        pageModePanel.carriageReturn();
View Full Code Here

TOP

Related Classes of javax.swing.ButtonGroup

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.