Package javax.swing

Examples of javax.swing.JRadioButton.addActionListener()


    panel.add(commaButton);
    group.add(commaButton);

    JRadioButton spaceButton = new JRadioButton("Space");
    spaceButton.setActionCommand(" ");
    spaceButton.addActionListener(createDelimiterRadioButtonListener());
    panel.add(spaceButton);
    group.add(spaceButton);

    return panel;
  }
View Full Code Here


        }

        String seriesName = series.getDescription();
        JRadioButton seriesRadioButton = new JRadioButton(seriesName);
        seriesRadioButton.setActionCommand(seriesName);
        seriesRadioButton.addActionListener(this);
        seriesRadioButton.setEnabled(isSeriesNonEmpty(series));
        panel.add(seriesRadioButton);
        panel.add(Box.createRigidArea(new Dimension(3, 3)));
        seriesGroup.add(seriesRadioButton);
        checkInitialMeanSourceSeries(series, seriesRadioButton);
View Full Code Here

      if (!series.isSynthetic() && !series.isUserDefined()) {
        // Add radio button for all non-synthetic series.
        String seriesName = series.getDescription();
        JRadioButton seriesRadioButton = new JRadioButton(seriesName);
        seriesRadioButton.setActionCommand(seriesName);
        seriesRadioButton.addActionListener(this);
        seriesRadioButton.setEnabled(isSeriesNonEmpty(series));
        panel.add(seriesRadioButton);
        panel.add(Box.createRigidArea(new Dimension(3, 3)));
        seriesGroup.add(seriesRadioButton);
View Full Code Here

      if (series.isSynthetic()) {
        // Add radio button for all non-synthetic series.
        String seriesName = series.getDescription();
        JRadioButton seriesRadioButton = new JRadioButton(seriesName);
        seriesRadioButton.setActionCommand(seriesName);
        seriesRadioButton.addActionListener(this);
        seriesRadioButton.setEnabled(isSeriesNonEmpty(series));
        panel.add(seriesRadioButton);
        panel.add(Box.createRigidArea(new Dimension(3, 3)));
        seriesGroup.add(seriesRadioButton);
View Full Code Here

      JPanel buttonPanel = new JPanel();
      buttonPanel.setLayout(new GridLayout(3, 1));
      JLabel turnLabel = new JLabel("Turn:");
      buttonPanel.add(turnLabel);
      JRadioButton whiteTurnButton = new JRadioButton("White");
      whiteTurnButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          virtualBoard.isWhiteTurn = true;
        }
      });
      whiteTurnButton.setSelected(virtualBoard.isWhiteTurn);
View Full Code Here

          virtualBoard.isWhiteTurn = true;
        }
      });
      whiteTurnButton.setSelected(virtualBoard.isWhiteTurn);
      JRadioButton blackTurnButton = new JRadioButton("Black");
      blackTurnButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          virtualBoard.isWhiteTurn = false;
        }
      });
      blackTurnButton.setSelected(!virtualBoard.isWhiteTurn);
View Full Code Here

      for (int i = 0; i < lookAndFeels.length; i++) {
        final UIManager.LookAndFeelInfo lfInfo = lookAndFeels[i];
        final JRadioButton lfItem = new JRadioButton(lfInfo.getName());
        lfItem.setName(lfInfo.getClassName());
        lfItem.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              uncommittedPreferenceModel.setLookAndFeelClassName(
                lfInfo.getClassName());
            }
View Full Code Here

      try {
        final Class gtkLF =
          Class.forName("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
        final JRadioButton lfIGTK = new JRadioButton("GTK+ 2.0");
        lfIGTK.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              uncommittedPreferenceModel.setLookAndFeelClassName(
                gtkLF.getName());
            }
View Full Code Here

        final String format = (String) iter.next();
        final JRadioButton rdFormat = new JRadioButton(format);
        rdFormat.setAlignmentX(0);

        bgDateFormat.add(rdFormat);
        rdFormat.addActionListener(new ActionListener()
          {
            public void actionPerformed(ActionEvent e)
            {
              getModel().setDateFormatPattern(format);
              customFormatText.setEnabled(rdCustom.isSelected());
View Full Code Here

                    gbc.insets.top = 5;
                }
                add(button, gbc);
                group.add(button);
                button.setActionCommand(Integer.toString(i));
                button.addActionListener(this);
                this.spinners[i] = new SlidingSpinner(this, button);
            }
            else {
                JLabel label = new JLabel();
                add(label, gbc);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.