动态更新UI数据
1.使用
原理有一些复杂,毕竟涉及底层代码,所以我不会过多解释。
类路径:arc.scene.ui.layout.Cell
在其中的
在这其中可以看到
public Cell<Table> table(Cons<Table> cons){
Table table = new Table();
cons.get(table);
return add(table);
}
public Cell<Button> button(Cons<Button> cons, Runnable listener){
Button button = new Button();
button.clearChildren();
button.clicked(listener);
cons.get(button);
return add(button);
}
Cell<T>
。
也就是说这样的方法基本都可以使用
update()
。
使用:
这里不止dialog.cont.table可以,也可以是Button或者其他含有Cell这样的话就完成了,可以实现闪烁字体或者持续更新的文字显示。