使用JavaFX在macOS上更改拖放光标

时间:2019-08-28 17:46:08

标签: java macos javafx drag-and-drop cursor

当我拖动项目时,如何使用JavaFX在macOS上更改光标?

我尝试使用函数model.save('my_model.h5')来更改光标,但是当我拖动一个项目时,会在光标后面看到白皮书。

new_model = models.Sequential()
new_model.add(...)  # Some layers

# Here you add the model you previously trained
# In case you need to use another head, use model.layers[-1].output
convnet = KerasModel(inputs=model.inputs, outputs=model.output)
convnet.set_weights(WEIGHTS_FILE)  # The path to the file where you saved your model
convnet.trainable = False  # Lock in its weights
new_model.add(convnet)

# Add a new head if you got rid of it

示例:

  1. 拖动紫色线之前
  2. 拖动线
  3. 拖动后

使用自定义光标拖放:

drag and drop with custom cursor

我试图在Ubuntu 19和Windows 10上运行代码,但是这个问题不存在。

0 个答案:

没有答案