*/
private void insertVariable(String userCode) {
Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
if (focusOwner instanceof JTextField) {
JTextField textField = (JTextField)focusOwner;
textField.replaceSelection(userCode);
int lastCharacter = textField.getCaretPosition();
int firstCharacter = lastCharacter - userCode.length();
textField.select(firstCharacter, lastCharacter);
}
}