通过Cursor.getSystemCustomCursor可以使用哪些游标? [英] What cursors are available through Cursor.getSystemCustomCursor?

查看:172
本文介绍了通过Cursor.getSystemCustomCursor可以使用哪些游标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java.awt.Cursor具有方法 getSystemCustomCursor(String name) .

java.awt.Cursor has a method getSystemCustomCursor(String name).

那里的文档仅给出一个名称示例:"Invalid.16x16".这似乎不起作用,但是"Invalid.32x32"起作用.通过谷歌搜索,我找到了另一个有用的工作名称示例:"MoveDrop.32x32".

The documentation there gives only one example of a name: "Invalid.16x16". That doesn't seem to work, but "Invalid.32x32" does. Through googling, I've found one other example of a useful working name: "MoveDrop.32x32".

这种方法似乎很有用.例如,没有预定义的在后台工作"(混合箭头/沙漏)光标,但也许可以通过此方法使用.

This method seems like it could be useful. For example, there is no predefined "working in background" (mixed arrow/hourglass) cursor but perhaps it's available through this method.

有人知道可用的游标名称,或如何在特定系统上枚举它们吗?

Does anyone know what cursor names are available, or how to enumerate them on a particular system?

推荐答案

请参阅定义自定义系统游标的cursors.properties文件.它位于<path_to_jre>\lib\images\cursors文件夹中.例如,有一个MoveDrop.32x32的定义:

See cursors.properties files that defines custom system cursors. It resides in <path_to_jre>\lib\images\cursors folder. For example there is a definition of MoveDrop.32x32:

Cursor.MoveDrop.32x32.File=win32_MoveDrop32x32.gif
Cursor.MoveDrop.32x32.HotSpot=0,0
Cursor.MoveDrop.32x32.Name=MoveDrop32x32

有关自定义信息,请参见自定义光标形状文章游标定义示例.

See Custom Cursor Shapes article for a custom cursor definition example.

不确定是否有一种方法可以查询此文件中的预定义系统游标.因此,此方法在某些情况下可能不是很有用.

Not sure there is a way to query this file for predefined system cursors. So this method may not be very useful in certain scenarios.

请参见 Cursor.getPredefinedCursor 获取预定义的光标.

See Toolkit.createCustomCursor() for a simpler way to create a custom cursor. Or you can use Cursor.getPredefinedCursor to get predefined cursors.

这篇关于通过Cursor.getSystemCustomCursor可以使用哪些游标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆