Java Code Examples for javax.swing.JRadioButton#setEnabled()
The following examples show how to use
javax.swing.JRadioButton#setEnabled() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnalyzeDialog.java From FancyBing with GNU General Public License v3.0 | 6 votes |
private JComponent createColorPanel() { m_colorBox = Box.createVerticalBox(); ButtonGroup group = new ButtonGroup(); m_black = new JRadioButton(i18n("LB_BLACK")); m_black.setToolTipText(i18n("TT_ANALYZE_BLACK")); m_black.setEnabled(false); group.add(m_black); m_colorBox.add(m_black); m_white = new JRadioButton(i18n("LB_WHITE")); m_white.setToolTipText(i18n("TT_ANALYZE_WHITE")); m_white.setEnabled(false); group.add(m_white); m_colorBox.add(m_white); return m_colorBox; }
Example 2
Source File: ZipDialog.java From Compressor with GNU General Public License v2.0 | 6 votes |
private JPanel getTopLeftPanel() { JPanel ret = new JPanel(); JLabel tips = new JLabel("文件编码:"); ret.add(tips); JRadioButton utf8 = new JRadioButton("UTF-8"); ret.add(utf8); JRadioButton gbk = new JRadioButton("GBK"); ret.add(gbk); ButtonGroup bg = new ButtonGroup(); bg.add(utf8); bg.add(gbk); utf8.setSelected(true); gbk.setEnabled(false); return ret; }
Example 3
Source File: ZipDialog.java From Compressor with GNU General Public License v2.0 | 6 votes |
private JPanel getTopRightPanel() { JPanel ret = new JPanel(); JRadioButton uncode = new JRadioButton("不加密"); ret.add(uncode); JRadioButton encode = new JRadioButton("加密"); ret.add(encode); ButtonGroup bg = new ButtonGroup(); bg.add(uncode); bg.add(encode); uncode.setSelected(true); encode.setEnabled(false); return ret; }
Example 4
Source File: NewRepositoryDialog.java From rapidminer-studio with GNU Affero General Public License v3.0 | 5 votes |
private NewRepositoryDialog() { super(RapidMinerGUI.getMainFrame(), "repositorydialog", true, new Object[]{}); Box firstPage = new Box(BoxLayout.Y_AXIS); ButtonGroup checkBoxGroup = new ButtonGroup(); Map<String, Component> cards = new HashMap<String, Component>(); cards.put("first", firstPage); cards.put("local", localRepositoryPanel); // register a radio button for each custom repository type for (CustomRepositoryFactory factory : CustomRepositoryRegistry.INSTANCE.getFactories()) { // some repos may not want to appear here if (!factory.showRepositoryConfigurationInNewRepositoryDialog()) { continue; } String key = factory.getI18NKey(); RepositoryConfigurationPanel repositoryConfigurationPanel = factory.getRepositoryConfigurationPanel(); JRadioButton radioButton = new JRadioButton(new ResourceActionAdapter(key)); radioButton.setEnabled(factory.enableRepositoryConfiguration()); radioButton.setSelected(repoConfigPanels.isEmpty()); repoConfigPanels.put(key, new Pair<>(repositoryConfigurationPanel, radioButton)); checkBoxGroup.add(radioButton); firstPage.add(radioButton); cards.put(factory.getI18NKey(), repositoryConfigurationPanel.getComponent()); } firstPage.add(Box.createVerticalGlue()); layoutDefault(cards); }
Example 5
Source File: VulcanTab.java From FoxTelem with GNU General Public License v3.0 | 5 votes |
private JRadioButton addRadioButton(String name, JPanel panel) { JRadioButton radioButton = new JRadioButton(name); radioButton.setEnabled(true); radioButton.addActionListener(this); panel.add(radioButton); return radioButton; }
Example 6
Source File: FilterPanel.java From FoxTelem with GNU General Public License v3.0 | 5 votes |
private JRadioButton addRadioButton(String name) { JRadioButton radioButton = new JRadioButton(name); radioButton.setEnabled(true); radioButton.addActionListener(this); add(radioButton); return radioButton; }
Example 7
Source File: SourceTab.java From FoxTelem with GNU General Public License v3.0 | 5 votes |
private JRadioButton addRadioButton(String name, JPanel panel) { JRadioButton radioButton = new JRadioButton(name); radioButton.setEnabled(true); radioButton.addActionListener(this); panel.add(radioButton); return radioButton; }
Example 8
Source File: CrsSelectionPanel.java From snap-desktop with GNU General Public License v3.0 | 5 votes |
@Override public void propertyChange(PropertyChangeEvent evt) { final Boolean enabled = (Boolean) evt.getNewValue(); for (CrsForm crsForm : crsForms) { final JRadioButton button = crsForm.getRadioButton(); button.setEnabled(enabled); final boolean selected = button.isSelected(); crsForm.getCrsUI().setEnabled(selected && enabled); } }
Example 9
Source File: AnalysisView.java From iBioSim with Apache License 2.0 | 4 votes |
private JPanel createSimulationTypeOptions() { JLabel choose2 = new JLabel("Analysis Type:"); ODE = new JRadioButton("ODE"); monteCarlo = new JRadioButton("Monte Carlo"); markov = new JRadioButton("Markov"); fba = new JRadioButton("FBA"); sbml = new JRadioButton("Model"); dot = new JRadioButton("Network"); xhtml = new JRadioButton("Browser"); ODE.addActionListener(this); monteCarlo.addActionListener(this); markov.addActionListener(this); fba.addActionListener(this); sbml.addActionListener(this); dot.addActionListener(this); xhtml.addActionListener(this); ButtonGroup simulationTypeButtons = new ButtonGroup(); simulationTypeButtons.add(ODE); simulationTypeButtons.add(monteCarlo); simulationTypeButtons.add(markov); simulationTypeButtons.add(fba); simulationTypeButtons.add(sbml); simulationTypeButtons.add(dot); simulationTypeButtons.add(xhtml); if (!Executables.reb2sacFound) { dot.setEnabled(false); xhtml.setEnabled(false); } ODE.setSelected(true); JPanel simulationTypeOptions = new JPanel(); simulationTypeOptions.add(choose2); simulationTypeOptions.add(ODE); simulationTypeOptions.add(monteCarlo); simulationTypeOptions.add(markov); simulationTypeOptions.add(fba); simulationTypeOptions.add(sbml); simulationTypeOptions.add(dot); simulationTypeOptions.add(xhtml); return simulationTypeOptions; }