简体   繁体   中英

how to declare an array of ObservableArrayList Java

If I have an observableList data1 = FXCollections.observableArrayList();

I want to stick it in an array because I have a bunch of them. Can I do that ? If yes, whats the syntax ?

List interface provides a method called toArray() to convert a list to array. This should do:

data1.toArray();

EDIT

As per the questioner input, you may need this:

observableList[] observableListArray = new observableList[SIZE_YOU_NEED];
observableListArray[index] = data1;

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