开发者

Converting java.util.List into a JavaFX sequence

开发者 https://www.devze.com 2022-12-23 02:24 出处:网络
What is the most concise way of converting a java.util.List into a normal JavaFX sequence (in JavaFX)?

What is the most concise way of converting a java.util.List into a normal JavaFX sequence (in JavaFX)?

e.g.

def myList = java.util.Arrays.asList(1, 2, 3);
def mySequence = .开发者_StackOverflow社区.. // a sequence containing [1, 2, 3]


This is the most concise way I could find - there may be a more direct method though

def myList = java.util.Arrays.asList(1, 2, 3);
def mySequence = for (i in myList) i;

println("mySequence={mySequence}");
0

精彩评论

暂无评论...
验证码 换一张
取 消