Re: [問題] 滑鼠 setCursor 的問題

看板java作者 (偶數傳奇)時間16年前 (2009/05/13 21:51), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/4 (看更多)
※ 引述《sbrhsieh (sbr)》之銘言: : ※ 引述《Atenp (偶數傳奇)》之銘言: : : 如果我在一個JFrame上 : : setEnabled 一個面積比較小的 progress Bar 這個打錯了~應該是 setVisible() 不是把progress bar 放進 jframe ^^" : : 有辦法在整個 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: 118.169.185.132

05/13 22:17, , 1F
什麼意思?!
05/13 22:17, 1F
文章代碼(AID): #1A2j16KC (java)
討論串 (同標題文章)
文章代碼(AID): #1A2j16KC (java)