javax.swing.JComboBox.getActionCommand()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(193)

本文整理了Java中javax.swing.JComboBox.getActionCommand()方法的一些代码示例,展示了JComboBox.getActionCommand()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.getActionCommand()方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:getActionCommand

JComboBox.getActionCommand介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JComboBox comboBox=(JComboBox) e.getSource();
String s1=(String) comboBox.getSelectedItem();
String s2=(String) comboBox.getActionCommand();

代码示例来源:origin: pentaho/pentaho-reporting

/**
 * Tells the editor to stop editing and accept any partially edited value as the value of the editor.  The editor
 * returns false if editing was not stopped; this is useful for editors that validate and can not accept invalid
 * entries.
 *
 * @return true if editing was stopped; false otherwise
 */
public boolean stopCellEditing() {
 try {
  // ugly hack to make the combobox editor commit any changes before we go out of focus.
  comboBox.actionPerformed( new ActionEvent( this, ActionEvent.ACTION_PERFORMED, comboBox.getActionCommand() ) );
  fireEditingStopped();
  return true;
 } catch ( final Exception e ) {
  DebugLog.log( "Exception caught while editing cell-value", e ); // NON-NLS
  // exception ignored
  fireEditingCanceled();
  return true;
 }
}

代码示例来源:origin: pentaho/pentaho-reporting

/**
 * Tells the editor to stop editing and accept any partially edited value as the value of the editor.  The editor
 * returns false if editing was not stopped; this is useful for editors that validate and can not accept invalid
 * entries.
 *
 * @return true if editing was stopped; false otherwise
 */
public boolean stopCellEditing() {
 try {
  // ugly hack to make the combobox editor commit any changes before we go out of focus.
  comboBox.actionPerformed( new ActionEvent( this, ActionEvent.ACTION_PERFORMED, comboBox.getActionCommand() ) );
  fireEditingStopped();
  return true;
 } catch ( final Exception e ) {
  DebugLog.log( "Error on Stop", e );
  // exception ignored
  fireEditingCanceled();
  return true;
 }
}

相关文章

JComboBox类方法