本文整理匯總了Java中javax.swing.JRadioButton.setMnemonic方法的典型用法代碼示例。如果您正苦於以下問題:Java JRadioButton.setMnemonic方法的具體用法?Java JRadioButton.setMnemonic怎麽用?Java JRadioButton.setMnemonic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JRadioButton
的用法示例。
在下文中一共展示了JRadioButton.setMnemonic方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createRadioButton
import javax.swing.JRadioButton; //導入方法依賴的package包/類
final public static JRadioButton createRadioButton(String strPkey, ActionListener al) {
final JRadioButton objLjRadioButton = new JRadioButton(Tools.getLocaleString(strPkey));
objLjRadioButton.setMnemonic(Tools.getMnemonicChar(strPkey));
objLjRadioButton.addActionListener(al);
return objLjRadioButton;
}
示例2: initComponents
import javax.swing.JRadioButton; //導入方法依賴的package包/類
private void initComponents() {
jrbOneShot = new JRadioButton("One Shot");
jrbOneShot.setMnemonic(KeyEvent.VK_O);
jrbOneShot.setActionCommand("One Shot");
jrbOneShot.setSelected(true);
jrbOneShot.addActionListener(this);
jrbMonteCarlo = new JRadioButton("Monte-Carlo");
jrbMonteCarlo.setMnemonic(KeyEvent.VK_M);
jrbMonteCarlo.setActionCommand("Monte-Carlo");
jrbMonteCarlo.addActionListener(this);
buttonGroup = new ButtonGroup();
buttonGroup.add(jrbOneShot); buttonGroup.add(jrbMonteCarlo);
jlTimeUnits = new JLabel("Time units: ");
jlMaxIterations = new JLabel("Max iterations: ");
jlSelectExtensions = new JLabel("Select your report extension(s)");
jcbExtensions = new ArrayList<JCheckBox>(6);
jcbDocx = new JCheckBox("docx"); jcbExtensions.add(jcbDocx);
jcbHtml = new JCheckBox("html"); jcbExtensions.add(jcbHtml);
jcbPdf = new JCheckBox("pdf"); jcbExtensions.add(jcbPdf);
jcbPptx = new JCheckBox("pptx"); jcbExtensions.add(jcbPptx);
jcbOdt = new JCheckBox("odt"); jcbExtensions.add(jcbOdt);
jcbXlsx = new JCheckBox("xlsx"); jcbExtensions.add(jcbXlsx);
jcbPdf.setSelected(true);
for(JCheckBox jcb : jcbExtensions) jcb.setEnabled(false);
this.jlSelectModelingProject = new JLabel("Select your modeling project");
this.jcbModelingProjects = new JComboBox<String>();
// Retrieval of all user workspaces modeling projects
for(String project : WorkspaceManager.getModelingProjects())
this.jcbModelingProjects.addItem(project);
this.jcbModelingProjects.setSelectedIndex(0);
this.jcbModelingProjects.addActionListener(this);
this.jcbModelingProjects.setEnabled(false);
this.jlSelectReportTemplate = new JLabel("Select the report template you want to use");
this.jcbReportTemplates = new JComboBox<String>();
// Retrieval of all report templates of the selected project (the first one by default)
for(String template : WorkspaceManager.getTemplates(this.jcbModelingProjects.getItemAt(0)))
this.jcbReportTemplates.addItem(template);
if(this.jcbReportTemplates.getModel().getSize() == 0)
this.jcbReportTemplates.addItem("No report templates available !");
this.jcbReportTemplates.setSelectedIndex(0);
this.jcbReportTemplates.addActionListener(this);
this.jcbReportTemplates.setEnabled(false);
jtfTimeUnits = new JTextField("1000");
PlainDocument docTimeUnits = (PlainDocument) jtfTimeUnits.getDocument();
docTimeUnits.setDocumentFilter(new IntFilter());
jtfMaxIterations = new JTextField("100");
PlainDocument docMaxIterations = (PlainDocument) jtfMaxIterations.getDocument();
docMaxIterations.setDocumentFilter(new IntFilter());
// "One Shot" simulation selected by default
jtfMaxIterations.setEnabled(false);
jtfTimeUnits.setColumns(5);
jtfMaxIterations.setColumns(5);
jbStart = new JButton("Start");
jbStart.addActionListener(this);
jbStop = new JButton("Stop");
jbStop.addActionListener(this);
jbStop.setEnabled(false);
jpLoader = new PanelLoader("status bar", 100);
}