0

In Perl Tk the trick is that you can set the 'insert on time' of a text widget to 0, which has the effect of turning off the blinking cursor:

$self->{status_line}=$self->{status_frame}->Text(
-width=>80,-font=>[-size=>10],-height=>1,
-insertontime=>0)->pack(-side=>'left');

Is there an equivalent of this in Java to turn off the blinking cursor?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
javachessgui
  • 147
  • 2
  • 11
  • This is pretty much a duplicate of [Hide input caret of TextField in JavaFX8](http://stackoverflow.com/questions/27315861/hide-input-caret-of-textfield-in-javafx8), but I won't make it as a duplicate as James' answer is better than any current answers in the original question. – jewelsea Jun 02 '15 at 22:46

1 Answers1

2

You can do this in CSS with

-fx-display-caret: false ;

either inline:

textArea.setStyle("-fx-display-caret: false;");

or in an external CSS file:

.text-area {
    -fx-display-caret: false ;
}
James_D
  • 201,275
  • 16
  • 291
  • 322
  • Not really: I just read the [docs](http://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html#textinputcontrol) ;) Mark the answer as correct, though, if it does what you need. That way it will be easier for other users to find it. – James_D Jun 02 '15 at 13:38