I am using java and I am trying to do JTextAreathat which is not editable but still has a caret in the field. In other words, a text area that does not display the characters entered by the user, but still has a blinking caret (i.e. focus).
JTextArea
I am honestly a dead end on this issue. I tried dumping with setEditable, but this is not a way to save the caret. I also tried to delete the character that the user enters as soon as he types it, but I can not stop him blinking on the screen.
setEditable
I think the following will help you:
textArea.getCaret().setVisible(true);
or
textArea.getCaret().setSelectionVisible(true);
, TextArea EditorPane , , - , , .
, , , , .
text.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { text.getCaret().setVisible(true); // show the caret anyway } });