本文整理了Java中javax.swing.JTextField.getActionListeners()
方法的一些代码示例,展示了JTextField.getActionListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.getActionListeners()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:getActionListeners
暂无
代码示例来源:origin: jsettlers/settlers-remake
private void initializeChatFor(IJoinPhaseMultiplayerGameConnector joinMultiPlayerMap) {
joinMultiPlayerMap.setChatListener(new IChatMessageListener() {
@Override
public void chatMessageReceived(String authorId, String message) {
chatArea.append(authorId + ": " + message + "\n");
}
@Override
public void systemMessageReceived(IMultiplayerPlayer author, ENetworkMessage message) {
chatArea.append(Labels.getString("network-message-" + message.name()) + "\n");
}
});
ActionListener sendChatMessage = e -> {
String message = chatInputField.getText();
if (!message.equals("")) {
joinMultiPlayerMap.sendChatMessage(message);
chatInputField.setText("");
}
};
J8Arrays.stream(sendChatMessageButton.getActionListeners()).forEach(sendChatMessageButton::removeActionListener);
J8Arrays.stream(chatInputField.getActionListeners()).forEach(chatInputField::removeActionListener);
sendChatMessageButton.addActionListener(sendChatMessage);
chatInputField.addActionListener(sendChatMessage);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-ui
if (starterPanel.jTextFieldSN().getActionListeners().length == 0) {
starterPanel.jTextFieldSN().addActionListener(new ActionListener() {
@Override
内容来源于网络,如有侵权,请联系作者删除!