62,614
社区成员
发帖
与我相关
我的任务
分享
Action sendMessage = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
System.out.println("........");
}
};
sendButton.getActionMap().put("send", sendMessage);
InputMap inputMap = sendButton.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), "send");