※ 引述《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