如何在javafx 2中创建一个自动完成的combobox。使用现代的.fxml和控制器。java(复制)

时间:2021-02-06 17:00:41

This question already has an answer here:

这个问题已经有了答案:

how to make a similer autocomplete combobox in javafx 2.x using modern .fxml and controller.java as this one is made

如何在javafx 2中制作一个更高级的自动完成的combobox。使用现代的.fxml和控制器。这个是java做的。

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)

上面提到的演示是混乱的,很难配置和独立(需要一些jar)

2 个解决方案

#1


0  

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:

标准集包含的样本也有类似的控制。它是开源的,所以您可以下载它并查看源代码:

http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-2158687.html

http://www.oracle.com/technetwork/java/javase/overview/javafx -样品- 2158687. - html

take a look at SearchBox.java

看看SearchBox.java。

#2


0  

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。

#1


0  

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:

标准集包含的样本也有类似的控制。它是开源的,所以您可以下载它并查看源代码:

http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-2158687.html

http://www.oracle.com/technetwork/java/javase/overview/javafx -样品- 2158687. - html

take a look at SearchBox.java

看看SearchBox.java。

#2


0  

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。