本文介绍了如何使用ControlsFX实现自动完成文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ControlsFX的最新版本(8.0.5),我想我需要自动完成文本字段一点点的帮助,因为我在这个非常新。

我从这个code 这里

  AutoCompletionTextFieldBinding.createBinding(
MyTxtField,
SuggestionProvider.create(你好,你好世界,苹果,酷,歌诗达,可口可乐,可口可乐)
);

但它显示一个错误:方法SuggestionProvider不适用

任何意见,来实现这个自动完成,以便有像 ID

解决方案

如果您检查成绩单到您所引述的code
https://bitbucket.org/controlsfx/controlsfx/pull-request/196/auto-complete-support-see-127/diff (早2月)
和controlsfx 8.05的发布日期3月4日,可能的解释是该code很可能不工作,因为你所引用的只是实验性的API,尚未最终确定,然后。最终版本目前在最后8.05工作之一

  TextFields.bindAutoCompletion(
            文本域,
            嘿,你好,你好世界,苹果,酷,歌诗达,可口可乐,可口可乐);

和其他的API,您可以检查使用自动完成从IDE

我建议检查出controlfx 8.05样品看看源$ C ​​$ C,这将有很大的帮助:}

I'm using the latest version(8.0.5) of ControlsFX and I think I need a little help with the AutoComplete TextField because I'm very new at this.

I got this code from here

AutoCompletionTextFieldBinding.createBinding(
MyTxtField,
SuggestionProvider.create("Hey", "Hello", "Hello World", "Apple", "Cool", "Costa", "Cola", "Coca Cola")
);

But it show a error: method SuggestionProvider is not applicable.

Any advice to implement this autocomplete in order to have an array like a dictionary with ID and VALUE?

解决方案

If you check the transcript to which you have quoted the codehttps://bitbucket.org/controlsfx/controlsfx/pull-request/196/auto-complete-support-see-127/diff (early feb)and the release date of controlsfx 8.05 dated 4 march http://fxexperience.com/controlsfx/ , likely explanation is that the code is likely not working because what you have quoted is just experimental API that yet to be finalized then. The final version is the one currently working in the final 8.05as in

TextFields.bindAutoCompletion(
            textField,
            "Hey", "Hello", "Hello World", "Apple", "Cool", "Costa", "Cola", "Coca Cola");

and other API you can check using autocomplete from your IDE

I recommend checking out controlfx 8.05 samples to look at the source code and that will help a lot :}

这篇关于如何使用ControlsFX实现自动完成文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 02:29