0
我正在使用自定義光標,它需要在屏幕中的某些組件上有所不同。如何在JavaFX Accordion標題欄中更改光標
當我設置的光標手風琴,它不影響標題頭,但效果各TitledPanes的身體。我甚至試圖爲每個TitledPane設置光標,但它不會影響標題標題。我正在使用以下方式更改光標。
ImageCursor cursor_title = new ImageCursor(cursorImg_title,cursorImg_title.getWidth()/2,cursorImg_title.getHeight()/2);
accordionBody.setCursor(cursor_title);
有沒有辦法改變一個JavaFX手風琴的標題欄中的光標?
更多....
我改變了標題欄的填充使用CSS如下。希望它與問題沒有任何關係。
.titled-pane > .title {
-fx-padding: 30;
}
你也可以直接在css文件中設置光標,這可能比搞亂查找更容易:'.accordian .title {-fx-cursor:...}' –
@James_D'.accordian' ??沒有看到發生任何事情。你的意思是'.titled-pane>'是不是?但是當我使用'.titled-pane> .title {-fx-cursor:url(「myCursor.gif」)}'它給了我一個錯誤,因爲'java.lang.String不能轉換爲javafx.scene.Cursor' –