Java Swing Key Event recipientHintSelected(String hintString, TextField toList, boolean shiftKeyPressed)

Here you can find the source of recipientHintSelected(String hintString, TextField toList, boolean shiftKeyPressed)

Description

recipient Hint Selected

License

Open Source License

Declaration

static final public void recipientHintSelected(String hintString, TextField toList, boolean shiftKeyPressed) 

Method Source Code

//package com.java2s;

import java.awt.TextField;

public class Main {
    static final public void recipientHintSelected(String hintString, TextField toList, boolean shiftKeyPressed) {
        if (shiftKeyPressed) {
            String currentList = toList.getText();

            if (currentList == null || currentList.length() == 0)
                toList.setText(hintString);
            else/*from  ww w  .  j av  a  2 s.  co m*/
                toList.setText(currentList + ", " + hintString);
        } else
            toList.setText(hintString);
    }
}

Related

  1. keyEventGetKeyText(int keycode)
  2. keyEventModifiersToKeyStrokeModifiers(int modifiers)
  3. keyStrokeModMac(String keyStrokeStr)
  4. press(int key)
  5. pressKey(final int key)
  6. rejectNonNumericKeys(KeyEvent evt)
  7. retargetKeyEvent(KeyEvent e, Component target)
  8. setKeystroke(JMenuItem m, int key)
  9. simulateKeyPressed(Component component, int key)