【问题标题】:Background mouse cursor (JavaFX)背景鼠标光标 (JavaFX)
【发布时间】:2019-01-22 08:33:22
【问题描述】:

已经问过一个类似的问题: Java swing "working in background" mouse cursor

和上一个问题一样,我需要“背景鼠标光标”(等待+箭头)。

在类javafx.scene.Cursor中没有定义对应的常量。或许JavaFX 技术有更好的解决方案?

【问题讨论】:

    标签: java javafx cursor


    【解决方案1】:

    正如你所说,Cursor 中没有这样的预定义光标

    但是可以定义自己的光标:

    Image image = new Image("batman.png");  //pass in the image path
    scene.setCursor(new ImageCursor(image));
    

    (来自教程https://blog.idrsolutions.com/2014/05/tutorial-change-default-cursor-javafx/的示例)

    也可以在这里查看相关问题:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多