移动光标在Mac OS X上的某个点上不显示在foucus上 [英] move cursor is not displaying on foucus at some point on Mac OS X

查看:240
本文介绍了移动光标在Mac OS X上的某个点上不显示在foucus上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有基于摇摆的应用程序,每当我们移动鼠标在一个组件,它显示移动光标图标,通过拖动我们移动该组件。我已经使用的代码。

I have swing based application and whenever we move mouse on a component it displays move cursor icon and by dragging we move that component.I have used code for that.

'mycomponent.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR))'

'mycomponent.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR))'

它在Windows 7,8中正常工作正常。为其他图标它在Mac中正常工作OS X喜欢
代码。

Its working fine in windows 7,8 properly.Even for others icon it works properly in Mac OS X like code for.


  • Curser.CROSSHAIR_CURSOR

  • Curser.CROSSHAIR_CURSOR

Curser.WAIT_CURSOR

Curser.WAIT_CURSOR

Curser.SE_RESIZE_CURSOR

Curser.SE_RESIZE_CURSOR

只有在Cursor.MOVE_CURSOR的情况下,它显示默认的鼠标图标和移动组件。我已经搜索了很多,我发现解决方案使用自定义鼠标图标,但我不想实现自定义鼠标图标。
有什么想法我做错了什么?

Only in case of "Cursor.MOVE_CURSOR" it shows default mouse icon and also moving component.I have searched a lot for it and somewhere I found solution using custom mouse icon but I don't want to implement the custom mouse icon. So have any idea what I am doing wrong ?

推荐答案

假设这个结果是按照设计的意图,如这里所述,Mac使用不会如果您在此上下文中选择显示 Cursor.HAND_CURSOR ,则会感到惊讶。

Assuming that this result is intended by design, as suggested here, Mac uses will not be surprised if you choose to display Cursor.HAND_CURSOR in this context.

if (System.getProperty("os.name").startsWith("Mac OS X")) {
    component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}

这篇关于移动光标在Mac OS X上的某个点上不显示在foucus上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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