简体   繁体   中英

Loading data from database in the background to tableview JavaFX when I use the scrolling mouse

The database has more than 10k rows of data. Everyone will be processed (translated) before it is displayed. That is, one column will be loaded on the rigid and the other is compared with the dictionary and displayed if there is another table in the database. Therefore, there is a lot of data I load of 50 pieces in use scrolling mouse. In order not slowed to the program it plans to do it so that when you use the scroll created a new thread and just charge in the background. I mean mainly about how to place it in the case of multi-threading. Maybe you have some advice or sample code. Thanks in advance

To solve this task you should to use javafx.concurrent.Task , Example . And simple handle your scroll event, on scroll populate table with additional values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM