本文整理匯總了Java中javax.swing.ButtonModel.getActionCommand方法的典型用法代碼示例。如果您正苦於以下問題:Java ButtonModel.getActionCommand方法的具體用法?Java ButtonModel.getActionCommand怎麽用?Java ButtonModel.getActionCommand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.ButtonModel
的用法示例。
在下文中一共展示了ButtonModel.getActionCommand方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setLookAndFeel
import javax.swing.ButtonModel; //導入方法依賴的package包/類
@Action
public void setLookAndFeel() {
ButtonModel model = lookAndFeelRadioGroup.getSelection();
String lookAndFeelName = model.getActionCommand();
try {
setLookAndFeel(lookAndFeelName);
} catch (Exception ex) {
displayErrorMessage(resourceMap.getString("error.unableToChangeLookAndFeel") +
"to "+lookAndFeelName, ex);
}
}
示例2: getSelectedRadio
import javax.swing.ButtonModel; //導入方法依賴的package包/類
protected String getSelectedRadio()
{
ButtonModel m = buttonGroup.getSelection();
if (m != null) return m.getActionCommand();
return "";
}
示例3: getPropertySource
import javax.swing.ButtonModel; //導入方法依賴的package包/類
public EdgePropertySource getPropertySource() {
ButtonModel bm = edgegroup.getSelection();
String action = bm.getActionCommand();
return EdgePropertySource.valueOf( action );
}