Thank you Abra for your requests. It made me rethink the problem. And here is the solution.
public void mousePressed(MouseEvent e)
{
DataButton jButton = (DataButton) e.getComponent();
String caption = jButton.getData();
JTextComponent focusElement = findFocusElement();
if (focusElement != null)
{
int position = focusElement.getCaretPosition();
String text = focusElement.getText();
String before = text.substring(0, position);
String after = text.substring(position);
focusElement.setText(before + caption + after);
focusElement.requestFocus();
focusElement.setCaretPosition(position + 1);
}
}