当前位置: 首页>>代码示例>>Java>>正文


Java JRadioButton.getText方法代码示例

本文整理汇总了Java中javax.swing.JRadioButton.getText方法的典型用法代码示例。如果您正苦于以下问题:Java JRadioButton.getText方法的具体用法?Java JRadioButton.getText怎么用?Java JRadioButton.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JRadioButton的用法示例。


在下文中一共展示了JRadioButton.getText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import javax.swing.JRadioButton; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent ae) 
{
    JRadioButton radio = (JRadioButton)ae.getSource();
    String s = radio.getText();
    
    for(int i = 0; i < progetto.scelteDomandaAttualeSize(); i++)
    {
        if(s.equals(progetto.mostraSceltaDomandaAttuale(i)))
        {
            indice = i;
        }
    }
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-I,代码行数:15,代码来源:RadioButtonListener.java

示例2: actionPerformed

import javax.swing.JRadioButton; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent ae) 
{
    JRadioButton radio = (JRadioButton)ae.getSource();
    String s = radio.getText();
    
    for(int i = 0; i < progetto.scelteDomandaAttualeSize(); i++)
    {
        if(s.equals(progetto.mostraSceltaDomandaAttuale(i)))
            indice = i;
    }
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-I,代码行数:13,代码来源:RadioButtonListener.java

示例3: sessionUI

import javax.swing.JRadioButton; //导入方法依赖的package包/类
protected void sessionUI() {
	setSessionID();
	//textfields needed for UI
	JTextField sessionIDText = new JTextField(getSessionID());
	sessionIDText.setEditable(false);
	JTextArea sessionDescripText = new JTextArea(4,5);
	sessionDescripText.setLineWrap(true);
	JScrollPane scrollPane = new JScrollPane(sessionDescripText);
       
	//Radio Button List
	JRadioButton newFeature = new JRadioButton("New Feature");
	JRadioButton bugFix = new JRadioButton("Bug Fix");
	JRadioButton refactoring = new JRadioButton("Refactoring");
	JRadioButton genComp = new JRadioButton("General Comprehension");
	JRadioButton other = new JRadioButton("Other");
	
	//Group the buttons
	ButtonGroup radioList = new ButtonGroup();
	radioList.add(newFeature);
	radioList.add(bugFix);
	radioList.add(refactoring);
	radioList.add(genComp);
	radioList.add(other);
	
	//Add to a JPanel
	JPanel radioPanel = new JPanel(new GridLayout(0, 1));
	radioPanel.add(newFeature);
	radioPanel.add(bugFix);
	radioPanel.add(refactoring);
	radioPanel.add(genComp);
	radioPanel.add(other);
	
	//Add everything to main JPanel
	JPanel sessionPanel = new JPanel(); //main panel
	sessionPanel.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.NONE;
	c.anchor = GridBagConstraints.NORTHWEST;
	
	c.gridx = 0;
	c.gridy = 0;
	sessionPanel.add(new JLabel("Generated Session ID:"),c);
	c.gridx++;
	sessionPanel.add(sessionIDText,c);
	c.gridx = 0;
	c.gridy++;
	sessionPanel.add(new JLabel("Session Purpose (select one):"),c);
	c.gridx++;
	sessionPanel.add(radioPanel,c);
	c.gridx = 0;
	c.gridy++;
	sessionPanel.add(new JLabel("Enter the Session Description:"),c);
	c.gridx++;
	c.fill = GridBagConstraints.HORIZONTAL;
	sessionPanel.add(scrollPane,c);
	
	final int selection = JOptionPane.showConfirmDialog(null, sessionPanel, 
			"Enter the Current Session Info.",
			JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
	if (selection == JOptionPane.OK_OPTION) {
		sessionDescrip = sessionDescripText.getText();
		if (newFeature.isSelected()) {
			sessionPurpose = newFeature.getText();
		} else if (bugFix.isSelected()) {
			sessionPurpose = bugFix.getText();
		} else if (refactoring.isSelected()) {
			sessionPurpose = refactoring.getText();
		} else if (genComp.isSelected()) {
			sessionPurpose = genComp.getText();
		} else if (other.isSelected()) {
			sessionPurpose = other.getText();
		} else {
			sessionPurpose = new String();
			System.out.println("Warning! "
					+ "Your Session Purpose has not been selected.");
		}
		hasSessionInfo = true;
	}  
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:80,代码来源:SessionInfoHandler.java


注:本文中的javax.swing.JRadioButton.getText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。