from http://docs.oracle.com/javafx/2/api/javafx/scene/control/Cell.html :

"The Cell API is used for virtualized controls such as ListView, TreeView, and TableView. A Cell is a Labeled Control, and is used to render a single "row" inside a ListView, TreeView or TableView."

Why are they virtualized?

有帮助吗?

解决方案

When you have a lot of data to display in a Control such as a ListView, you need some way of virtualizing the Nodes created and used. Otherwise it will affect the memory footprint and consequently the time.

For example, if you have 10 million data items, you don’t want to create 10 million Nodes. So you create enough Nodes to fill the display dynamically and reuse them as the user scrolls through the ListView control.

From documentation:

Because TreeView, ListView, TableView and other such controls can potentially be used for displaying incredibly large amounts of data, it is not feasible to create an actual Cell for every single item in the control. We represent extremely large data sets using only very few Cells. Each Cell is "recycled", or reused. This is what we mean when we say that these controls are virtualized.

P.S : every framework has this kind of virtualization, be it Android, WPF , JavaFX etc.

From one of the developers of JavaFX: http://fxexperience.com/2009/09/ui-virtualization/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top