java清空textarea,如何在Java中的TextArea中关闭闪烁的光标?

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?

解决方案

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 ;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值