2016-10-26 9 views
0

scrollpaneに透明な背景を設定できません。おそらくそれにはanchorpaneが含まれており、anchorpaneにはボタンが含まれていると思われますか? anchorpaneからscrollpaneと赤から白の背景:JavaFX ScrollPane透明な背景の設定方法

enter image description here

答えて

0

はFXMLであなたのAnchorPaneにIDを設定して、あなたのCSSの--fx背景色にIDを割り当てる:透明。

これはうまくいきます。

この質問

JavaFX ScrollPane border and background

+0

が動作しませんでした。スクロールペインで試しました。 .scrollpane> .viewport { -fx-background-color:transparent; } しかし、何も – ground

+0

は、リンクを使用して答えを更新しました。そのリンクを参照してください。 –

0
あなたは CSSを使用する必要が

と、このような参照してくださいされていない場合:(


.scroll-pane{ 
    -fx-background-color:transparent; 
} 

ScrollPaneが持っている原因Viewport

.scroll-pane > .viewport { //not .scrollpane but .scroll-pane 
    -fx-background-color: transparent; 
} 

または

.scroll-pane .viewport { 
     -fx-background-color: transparent; 
} 

それはあなたがよくexternall CSSファイルを定義していないか、また、デフォルトを持っているのScrollPaneにコンテナのいくつかの種類が追加されているいずれか、動作しない場合背景色。

+0

ありがとう! – ground

+0

@ ground;)。 。 。 – GOXR3PLUS