从FXML设置TableView泛型? [英] Setting TableView generic type from FXML?

查看:325
本文介绍了从FXML设置TableView泛型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TableView JavaFX 2.2类有一个泛型类型 S ,我想知道如何从FXML设置它?

解决方案

同样发生在ListView或ComboBox上。但我认为在FXML文件中定义了控件,并且定义了一个通用的ListView或ComboBox或TableView等等。无论他们将要展示什么。



因此,对于我来说,在JavaFX控制器类中设置泛型类型更有意义,而不是在FXML文件中。 / p>

希望它有帮助。


The TableView class of JavaFX 2.2 has a generic type S, I am wondering how one can set this from FXML?

解决方案

The same happens to a ListView or ComboBox. But I think that in the FXML file you are defining the controls and you are defining a generic ListView or a ComboBox or TableView or whatever. No matter what they are going to show.

So to me it makes more sense to set the generic type in the JavaFX controller class, instead of in the FXML file.

Hope it helps.

这篇关于从FXML设置TableView泛型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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