java.awt.Button.getActionCommand()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(125)

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

Button.getActionCommand介绍

暂无

代码示例

代码示例来源:origin: org.w3c.jigsaw/jigsaw

public void mouseEntered(MouseEvent e) {
  Component comp = e.getComponent();
  if (comp instanceof Button) {
  String action = ((Button)comp).getActionCommand();
  if (action.equals(COMMIT_L)) {
    setMessage("Commit the changes to the server.");
  } else if (action.equals(RESET_L)) {
    setMessage("Reset changes");
  }
  }
}

代码示例来源:origin: org.w3c.jigsaw/jigsaw

public void mouseEntered(MouseEvent e) {
  Component comp = e.getComponent();
  if (comp instanceof Button) {
  String action = ((Button)comp).getActionCommand();
  if (action.equals(DELETE_L)) {
    setMessage("Delete this resource!");
  } else if (action.equals(REINDEX_L)) {
    setMessage("Reindex the children.");
  }
  }
}

代码示例来源:origin: net.java.openjdk.cacio/cacio-shared

/**
 * Receives notification when an action was performend on the button.
 * 
 * @param event
 *            the action event
 */
@Override
public void actionPerformed(ActionEvent event) {
  Button b = getAWTComponent();
  ActionListener[] l = b.getActionListeners();
  ActionEvent ev = new ActionEvent(b, ActionEvent.ACTION_PERFORMED, b
      .getActionCommand());
  // This sends both the new and old style events correctly.
  handlePeerEvent(ev);
}

相关文章