javax.swing.JTextField.getActionListeners()方法的使用及代码示例

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

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

JTextField.getActionListeners介绍

暂无

代码示例

代码示例来源:origin: jsettlers/settlers-remake

  1. private void initializeChatFor(IJoinPhaseMultiplayerGameConnector joinMultiPlayerMap) {
  2. joinMultiPlayerMap.setChatListener(new IChatMessageListener() {
  3. @Override
  4. public void chatMessageReceived(String authorId, String message) {
  5. chatArea.append(authorId + ": " + message + "\n");
  6. }
  7. @Override
  8. public void systemMessageReceived(IMultiplayerPlayer author, ENetworkMessage message) {
  9. chatArea.append(Labels.getString("network-message-" + message.name()) + "\n");
  10. }
  11. });
  12. ActionListener sendChatMessage = e -> {
  13. String message = chatInputField.getText();
  14. if (!message.equals("")) {
  15. joinMultiPlayerMap.sendChatMessage(message);
  16. chatInputField.setText("");
  17. }
  18. };
  19. J8Arrays.stream(sendChatMessageButton.getActionListeners()).forEach(sendChatMessageButton::removeActionListener);
  20. J8Arrays.stream(chatInputField.getActionListeners()).forEach(chatInputField::removeActionListener);
  21. sendChatMessageButton.addActionListener(sendChatMessage);
  22. chatInputField.addActionListener(sendChatMessage);
  23. }

代码示例来源:origin: org.codehaus.jtstand/jtstand-ui

  1. if (starterPanel.jTextFieldSN().getActionListeners().length == 0) {
  2. starterPanel.jTextFieldSN().addActionListener(new ActionListener() {
  3. @Override

相关文章

JTextField类方法