6

フォーカスされているときに TableView を囲む青い境界線を削除したいと思います。

ここに画像の説明を入力

Button や TextField などのほとんどのコンポーネントで次のようなことを行う caspian.css をチェックインしました。

.table-view:focused {
  -fx-background-color: -fx-focus-color,-fx-box-border,-fx-control-inner-background;
  -fx-background-insets: -1.4, 0, 1;
  -fx-background-radius: 1.4, 0, 0;
  /*....*/
  -fx-padding: 1; /* 0.083333em; */
}

私の質問は、最後に CSS についてです。色を透明にする代わりに、スタイルシートでこの指定をオーバーライドできますか?pseudoclass

4

2 に答える 2

9

はい、できます。スタイルシートで、次のように、独自に選択した JavaFX CSS プロパティを使用してまったく同じ CSS セレクターを定義します。

.table-view:focused {
  -fx-background-color: red /* or transparent or other preferred color */,-fx-box-border,-fx-control-inner-background;
  -fx-background-insets: -1.4, 0, 1;
  -fx-background-radius: 1.4, 0, 0;
  /*....*/
  -fx-padding: 1; /* 0.083333em; */
}
于 2012-11-01T18:23:39.830 に答える