public OptionsConnectionPanel() { ButtonGroup bg = new ButtonGroup(); bg.add(jrb_minutes); bg.add(jrb_seconds); bg.add(jrb_millisecs); jrb_millisecs.setSelected(true); lastSelected = MILLISECONDS; jrb_minutes.addActionListener(al); jrb_seconds.addActionListener(al); jrb_millisecs.addActionListener(al); JPanel jp_radio = new JPanel(); jp_radio.setLayout(new FlowLayout(FlowLayout.LEFT)); jp_radio.add(jrb_minutes); jp_radio.add(jrb_seconds); jp_radio.add(jrb_millisecs); JPanel jp_timeout = new JPanel(); jp_timeout.setLayout(new FlowLayout(FlowLayout.LEFT)); jftf_timeout.setColumns(20); jp_timeout.add(jftf_timeout); JPanel jp_label_grid = new JPanel(); jp_label_grid.setLayout(new GridLayout(2, 1)); jp_label_grid.add(new JLabel("Timeout in: "));
fileLocationRadio.addActionListener(new RadioButtonActionListener()); urlLocationRadio.setText(CheckStyleBundle.message("config.file.url.text")); urlLocationRadio.addActionListener(new RadioButtonActionListener()); classpathLocationRadio.setText(CheckStyleBundle.message("config.file.classpath.text")); classpathLocationRadio.addActionListener(new RadioButtonActionListener()); final ButtonGroup locationGroup = new ButtonGroup(); locationGroup.add(fileLocationRadio); locationGroup.add(urlLocationRadio); locationGroup.add(classpathLocationRadio);
JRadioButton coursesBtn = new JRadioButton("Courses"); //... coursesBtn.addActionListener(this); JRadioButton profsBtn = new JRadioButton("Professors"); //... coursesBtn.addActionListener(this); JRadioButton officeSpBtn = new JRadioButton("Office Spaces"); //... coursesBtn.addActionListener(this);
/** Creates new form ExportDiffPanel */ public ExportDiffPanel(JComponent attachComponent) { initComponents(); this.attachComponent = attachComponent; asFileRadioButton.addActionListener(this); attachRadioButton.addActionListener(this); attachPanel.add(attachComponent); attachComponent.setEnabled(false); fileTextField.setEnabled(true); }
private JRadioButton createComparatorButton(String name, int value, ButtonGroup group) { JRadioButton button = new JRadioButton(name); button.setActionCommand(String.valueOf(value)); button.addActionListener(this); group.add(button); return button; }
//The text field JTextField textField = new JTextField(); //The buttons JRadioButton rdbtnAllowEdit = new JRadioButton(); JRadioButton rdbtnDisallowEdit = new JRadioButton(); //The Group, make sure only one button is selected at a time in the group ButtonGroup editableGroup = new ButtonGroup(); editableGroup.add(rdbtnAllowEdit); editableGroup.add(rdbtnDisallowEdit); //add allow listener rdbtnAllowEdit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { textField.setEditable(true); } }); //add disallow listener rdbtnDisallowEdit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { textField.setEditable(false); } });
private JRadioButton addOption(String text, String imageResource, ButtonGroup group, int index, JPanel panel) { JLabel imageLabel = new JLabel(ResourceUtil.getImageIcon(imageResource)); JRadioButton button = createRadioButton(text); group.add(button); button.addActionListener(contentChangeActionListener); GridBagUtil.constrain(panel, imageLabel, 0, index, 1, 1, GridBagConstraints.NONE, GridBagConstraints.WEST, 0, 0, 5, 20, 0, 0); GridBagUtil.constrain(panel, button, 1, index, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, 1, 0, 5, 20, 0, 0); return button; }
jtf_custom.setEnabled(false); ButtonGroup bg = new ButtonGroup(); bg.add(jrb_req_get); bg.add(jrb_req_post); bg.add(jrb_req_put); bg.add(jrb_req_patch); bg.add(jrb_req_delete); jrb_req_get.addActionListener(jrbAL); jrb_req_post.addActionListener(jrbAL); jrb_req_put.addActionListener(jrbAL); jrb_req_patch.addActionListener(jrbAL); jrb_req_delete.addActionListener(jrbAL); jrb_req_head.addActionListener(jrbAL); jrb_req_options.addActionListener(jrbAL); jrb_req_trace.addActionListener(jrbAL); jrb_req_custom.addActionListener(jrbAL); JPanel jp_method = new JPanel(); jp_method.setBorder(BorderFactory.createTitledBorder("HTTP Method")); jp_method.setLayout(new GridLayout(5, 2)); jp_method.add(jrb_req_get); jp_method.add(jrb_req_post); jp_method.add(jrb_req_put); jp_method.add(jrb_req_patch); jp_method.add(jrb_req_delete);
JRadioButton enableButton = new JRadioButton("Enable"); JRadioButton disableButton = new JRadioButton("Disable"); JTextField field = new JTextField(); RadioListener listener = new RadioListener(field); enableButton.addActionListener(listener); disableButton.addActionListener(listener);
adjust5.setEnabled(false); ButtonGroup group = new ButtonGroup(); group.add(feedRadio); group.add(spindleRadio); group.add(rapidRadio); feedRadio.addActionListener((ActionEvent ae) -> radioSelected()); spindleRadio.addActionListener((ActionEvent ae) -> radioSelected()); rapidRadio.addActionListener((ActionEvent ae) -> radioSelected());
SslModeComponent() { super(); setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); fullModeRadioButton = new JRadioButton("Full Verification"); fullModeRadioButton.putClientProperty("SSL_MODE", AgentBootstrapperArgs.SslMode.FULL); fullModeRadioButton.setToolTipText("Perform a complete SSL verification before connecting to the agent."); noneModeRadioButton = new JRadioButton("No verification"); noneModeRadioButton.putClientProperty("SSL_MODE", AgentBootstrapperArgs.SslMode.NONE); noneModeRadioButton.setToolTipText("Completely disable any SSL verification"); noHostVerifyModeRadioButton = new JRadioButton("Don't verify host"); noHostVerifyModeRadioButton.putClientProperty("SSL_MODE", AgentBootstrapperArgs.SslMode.NO_VERIFY_HOST); noHostVerifyModeRadioButton.setToolTipText("Verify the server certificate, but not the hostname."); ButtonGroup sslModeButtonGroup = new ButtonGroup(); ActionListener actionListener = e -> { JRadioButton b = (JRadioButton) e.getSource(); setSslMode((AgentBootstrapperArgs.SslMode) b.getClientProperty("SSL_MODE")); }; for (JRadioButton button : Arrays.asList(fullModeRadioButton, noneModeRadioButton, noHostVerifyModeRadioButton)) { sslModeButtonGroup.add(button); add(button); button.addActionListener(actionListener); } }
private JRadioButton getTemporaryRadioButton() { if (temporaryRadioButton == null) { temporaryRadioButton = new JRadioButton(Constant.messages.getString("database.newsession.temporary")); temporaryRadioButton.addActionListener(this); } return temporaryRadioButton; }
jfc.addChoosableFileFilter(new RCFileFilter(FileType.ARCHIVE_EXT)); ButtonGroup group = new ButtonGroup(); group.add(jrb_archive); group.add(jrb_last); jrb_archive.setSelected(true); jrb_archive.addActionListener(al); jrb_last.addActionListener(al); jp_center_file.add(jb_archive_browse); jp_center.add(jp_center_file); jp_center.add(jrb_last); c.add(jp_center, BorderLayout.CENTER); JPanel jp_south = new JPanel(); jp_south.setLayout(new FlowLayout(FlowLayout.RIGHT)); jb_next.setMnemonic('n');
public JRadioButton getLiteralButton() { if (literalButton == null) { literalButton = new JRadioButton(); literalButton.setText("Literal"); literalButton.setMnemonic('L'); literalButton.setSelected(true); literalButton.addActionListener(this); } return literalButton; }
private JPanel buildConfigurationPanel() { final JPanel configPanel = new JPanel(new GridBagLayout()); configPanel.add(informationLabel, new GridBagConstraints(0, 0, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(16, 8), 0, 0)); useProjectConfigurationRadio.addActionListener(new RadioListener()); useModuleConfigurationRadio.addActionListener(new RadioListener()); excludeRadio.addActionListener(new RadioListener()); final ButtonGroup radioGroup = new ButtonGroup(); radioGroup.add(useProjectConfigurationRadio); radioGroup.add(useModuleConfigurationRadio); radioGroup.add(excludeRadio); configPanel.add(useProjectConfigurationRadio, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, ISOLATED_COMPONENT_INSETS, 0, 0)); configPanel.add(useModuleConfigurationRadio, new GridBagConstraints(0, 2, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, ISOLATED_COMPONENT_INSETS, 0, 0));
protected void createErrorRadio() { $objectMap.put("errorRadio", errorRadio = new JRadioButton()); errorRadio.setName("errorRadio"); errorRadio.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__errorRadio")); }
btnExit = new javax.swing.JButton(); btnExit.setAlignmentX(Component.LEFT_ALIGNMENT); buttonsPanel.add(btnExit); buttonsPanel.add(label1); setPanel = new JPanel(); setPanel.setLayout(new javax.swing.BoxLayout(setPanel, javax.swing.BoxLayout.LINE_AXIS)); setPanel.setOpaque(false); setPanel.setMaximumSize(new Dimension(200, 25)); setPanel.setAlignmentX(Component.LEFT_ALIGNMENT); buttonsPanel.add(setPanel); small3x3 = new JRadioButton("3x3"); small3x3.setForeground(Color.white); boolean selected3x3 = MageFrame.getPreferences().get(LAYOYT_CONFIG_KEY, MageBook.LAYOUT_3x3).equals(MageBook.LAYOUT_3x3); small3x3.setSelected(selected3x3); small3x3.addActionListener(e -> { big4x4.setSelected(false); mageBook.updateSize(MageBook.LAYOUT_3x3); big4x4 = new JRadioButton("4x4"); big4x4.setForeground(Color.white); big4x4.setSelected(!selected3x3); big4x4.addActionListener(e -> { small3x3.setSelected(false); mageBook.updateSize(MageBook.LAYOUT_4x4);
protected void createTraceRadio() { $objectMap.put("traceRadio", traceRadio = new JRadioButton()); traceRadio.setName("traceRadio"); traceRadio.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__traceRadio")); }
ButtonGroup n = new ButtonGroup(); n.add(this.radioIsTamperingSpaceToDashComment); n.add(this.radioIsTamperingSpaceToMultilineComment); n.add(this.radioIsTamperingSpaceToSharpComment); }); JPanel panelTamperingPreferences = new JPanel(); panelTamperingPreferences.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panelTampering.setBorder(BorderFactory.createEmptyBorder(10, 15, 0, 15)); panelTampering.add(new JLabel("<html><b>Tampering</b> / SQL expression alteration to bypass Web Application Firewall</html>"), BorderLayout.NORTH); panelTampering.add(panelTamperingPreferences, BorderLayout.CENTER); JPanel panelGeneralPreferences = new JPanel(); panelGeneralPreferences.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panelGeneral.setBorder(BorderFactory.createEmptyBorder(10, 15, 0, 15)); panelGeneral.add(new JLabel("<html><b>General</b> / Standard options</html>"), BorderLayout.NORTH); panelGeneral.add(panelGeneralPreferences, BorderLayout.CENTER); JPanel panelInjectionPreferences = new JPanel(); panelInjectionPreferences.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panelInjection.setBorder(BorderFactory.createEmptyBorder(10, 15, 0, 15)); this.checkboxIsTamperingEqualToLike.addActionListener(this.actionListenerSave); this.checkboxIsTamperingRandomCase.addActionListener(this.actionListenerSave); this.radioIsTamperingSpaceToMultilineComment.addActionListener(this.actionListenerSave); this.radioIsTamperingSpaceToDashComment.addActionListener(this.actionListenerSave); this.radioIsTamperingSpaceToSharpComment.addActionListener(this.actionListenerSave);
private JRadioButton getRadioButton(final String label) { final JRadioButton radioButton = new JRadioButton(label); radioButton.setBackground(WidgetUtils.BG_COLOR_BRIGHT); radioButton.setSelected(false); radioButton.addActionListener(e -> updateWidget()); return radioButton; }