如何使用现代 .fxml 和 controller.java 在 javafx 2.x 中制作自动完成组合框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12927504/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to make an autocomplete combobox in javafx 2.x using modern .fxml and controller.java
提问by kevin
how to make a similer autocomplete combobox in javafx 2.x using modern .fxml and controller.java as this one is made
如何使用现代 .fxml 和 controller.java 在 javafx 2.x 中制作一个类似的自动完成组合框
http://blog.ngopal.com.np/2011/07/04/autofill-textbox-with-filtermode-in-javafx-2-0-custom-control/
http://blog.ngopal.com.np/2011/07/04/autofill-textbox-with-filtermode-in-javafx-2-0-custom-control/
above mentioned demo is messy and hard to configure and be independant (requires some jars)
上面提到的演示很混乱,难以配置和独立(需要一些 jars)
采纳答案by Sergey Grinev
Ensemlbe -- a sample included into the standard set has similar control. It's opensourced, so you can download it and take a look into sources:
Ensmlbe - 包含在标准集中的样本具有类似的控制。它是开源的,因此您可以下载它并查看源代码:
http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-2158687.html
http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-2158687.html
take a look at SearchBox.java
看一眼 SearchBox.java
回答by privatejava
May be i am late but the link that you posted is now already compatible with the FXML as well just add
可能是我迟到了,但您发布的链接现在已经与 FXML 兼容,只需添加
to your fxml and also add the import directive in fxml.
到您的 fxml 并在 fxml 中添加导入指令。
Test Source Code is in Github: https://github.com/privatejava/javafx-autocomplete-field/blob/master/src/test/FXML.fxml#L12
测试源代码在 Github:https: //github.com/privatejava/javafx-autocomplete-field/blob/master/src/test/FXML.fxml#L12