作者sbrhsieh (sbr)
看板java
标题Re: [问题] 滑鼠 setCursor 的问题
时间Wed May 13 21:31:36 2009
※ 引述《Atenp (偶数传奇)》之铭言:
: 如果我在一个JFrame上
: setEnabled 一个面积比较小的 progress Bar
: 有办法在整个 JFrame 里
: 让我的滑鼠变成等待图形嘛?
: 好像只能对 progress bar 做 setCursor 会有用
: (只有在progress bar里面才会变成漏斗)
: 对 JFrame 好像无效, override掉 isVisible(), isDisplayable(), isEnabled()
: 好像也无效耶
: public void setCursor(Cursor cursor)
: Sets the cursor image to the specified cursor. This cursor image is
: displayed when the contains method for this component returns true for the
: current cursor location, and this Component is visible, displayable, and
: enabled. Setting the cursor of a Container causes that cursor to be displayed
: within all of the container's subcomponents, except for those that have a
: non-null cursor.
某些角度一个 container 被子元件占据的区域是可以看成不属於是 container 的
一部份,比如说滑鼠事件会转递到子元件,如果子元件有被注册了 mouse 相关的
listener(这会使子元件 enable mouse event processing)。
JFrame 本身一旦建构起来就不是一个空的(没有子元件)的 container。
http://www.javaworld.com.tw/jute/post/view?bid=5&id=6986&sty=3&keywords=JRootPane
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.173.129.3