Java JTextField Select recipientHintSelected(String hintString, JTextField toList, boolean shiftKeyPressed)

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

Description

recipient Hint Selected

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

import javax.swing.JTextField;

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

            if (currentList == null || currentList.length() == 0)
                toList.setText(hintString);
            else//from www .  j  a va2s  .c o m
                toList.setText(currentList + ", " + hintString);
        } else
            toList.setText(hintString);
    }
}

Related

  1. addSelectOnFocus(JTextField one)
  2. buttonFolderSelect(final JTextField text)
  3. createSelected(final JTextField textField, final JButton... btns)
  4. focusAndSelectTextInTextField(JTextField textField)
  5. newFileChooser(String dialogTitle, int fileSelectionMode, JTextField textField, String globalLocation)
  6. selectAllOnFocus(final JTextField jtf, final String recoverText, final Color forTip, final Color forContent)
  7. selectByTyping(javax.swing.JTree tree, javax.swing.JTextField textfield)
  8. wrapWithFileChooser(final Component aParent, final JTextField aTextField, final int aFileSelectionMode)