groovyfx

Update TreeView on custom TreeItem property change

Deadly 提交于 2020-01-15 15:57:27
问题 I have extended TreeCell and TreeItem class. MyTreeItem contains a custom property which I use inside MyTreeCell to render graphics/font etc. The problem is when I set MyTreeCell.customProperty I'm not sure how to make the TreeView/Cell redraw. For example: public class MyTreeItem extends TreeItem { Object customProperty public void setCustomProperty(Object customProperty) { this.customProperty = customProperty // how to fire a change event on the TreeView? } } Any comments on the solution or

Manage wait cursor for task

大憨熊 提交于 2019-12-12 00:41:47
问题 I'm outside the UI and wish to display a wait cursor while stuff is happening and using this basic pattern: on UI - primaryStage.scene.cursor = Cursor.WAIT try { do stuff off UI... } finally { on UI - primaryStage.scene.cursor = Cursor.DEFAULT } While running I can start another process which completes quickly and the Cursor is restored before the first task completes. I don't mind "waiting" while the first task completes, but I don't think this means doing the work on the UI thread? Is there