javafx 2文本字段中的texttext隐藏了一些Java 7更新后的焦点 [英] prompttext in textfield of javafx 2 hides on focus after some java 7 update

查看:167
本文介绍了javafx 2文本字段中的texttext隐藏了一些Java 7更新后的焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在制作简单的javafx 2 gui应用程序,发现文本字段获取焦点时,textfil 2中的prompttext就被隐藏起来。

这不是这样一些更新回来。
在这个更新之前,文本字段显示了prompttext,直到输入了一些文本。



这不好,真的需要解决这个问题。

解决方案

我刚刚通过对文本输入应用特定的CSS规则解决了这个问题。这是我使用的(应该​​适用于所有文本输入)

  .text-input,.text-input:focused { -fx-提示文本填写:深灰; } 


i've been making simple javafx 2 gui application and found that prompttext in textfield of javafx 2 hides as soon as the textfield gets focus.

this wasn't this way some updates back. prior to this update, the textfield showed the prompttext until some text is typed into.

this isn't good and really need a workaround for this.

解决方案

I just solved this same issue by applying particular CSS rules to text inputs. Here's what I used (which should apply to all text-inputs)

.text-input, .text-input:focused { -fx-prompt-text-fill:darkgray; }

这篇关于javafx 2文本字段中的texttext隐藏了一些Java 7更新后的焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆