2017-08-22 19 views
0

私はCSSを適用したい部分を次の写真に示します(「Estado」の列の部分) )CSSとJavaFX - TableViewのCSS

enter image description here

ここに私のCSSです:

.table-view{ 
    -fx-background-color: transparent; 
} 

.table-view:focused{ 
    -fx-background-color: transparent; 
} 

.table-view .column-header-background{ 
    -fx-background-color: linear-gradient(#101010 0%, #424141 100%); 
} 

.table-view .column-header-background .label{ 
    -fx-background-color: transparent; 
    -fx-text-fill: white; 
} 

.table-view .column-header { 
    -fx-background-color: transparent; 
} 

.table-view .table-cell{ 
    -fx-text-fill: white; 
} 

.table-row-cell{ 
    -fx-background-color: -fx-table-cell-border-color, #616161; 
    -fx-background-insets: 0, 0 0 1 0; 
    -fx-padding: 0.0em; 
} 

.table-row-cell:odd{ 
    -fx-background-color: -fx-table-cell-border-color, #424242; 
    -fx-background-insets: 0, 0 0 1 0; 
    -fx-padding: 0.0em; 
} 

.table-row-cell:selected { 
    -fx-background-color: #005797; 
    -fx-background-insets: 0; 
    -fx-background-radius: 1; 
} 

(せずに、それは私のテーブルビューの列ではありませんので、一部では白ですので、私は空の部分にCSSを適用する方法を知りたいです列)を表示します。

FXMLコード:

<?xml version="1.0" encoding="UTF-8"?> 

<?import java.lang.*?> 
<?import java.util.*?> 
<?import javafx.scene.*?> 
<?import javafx.scene.control.*?> 
<?import javafx.scene.layout.*?> 

<HBox prefHeight="300.0" prefWidth="773.0" 
     stylesheets="/iftorrent/gui/menuPrincipal/MenuPrincipalCSS.css" 
     xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" 
     fx:controller="iftorrent.gui.menuPrincipal.MenuPrincipalControlador"> 
    <children> 
     <TableView fx:id="tabela" prefWidth="773.0"> 
      <columns> 
       <TableColumn fx:id="numero" prefWidth="35.0" text="Nº " /> 
       <TableColumn fx:id="nome" prefWidth="183.0" text="Nome" /> 
       <TableColumn fx:id="tamanho" prefWidth="76.0" text="Tamanho" /> 
       <TableColumn fx:id="velocidade" prefWidth="76.0" text="Velocidade" /> 
       <TableColumn fx:id="tempo_estimado" prefWidth="120.0" text="Tempo Estimado" /> 
       <TableColumn fx:id="estado" prefWidth="283.0" text="Estado" /> 
       <TableColumn fx:id="progresso" prefWidth="283.0" text="Progresso" /> 
      </columns> 
     </TableView> 
    </children> 
</HBox> 
+1

これはHTMLコードではなく、FXMLのjavafxアプリケーションです –

答えて

3

あなたは.column-header-background内部.fillerを探しています。このルールを追加します。

.table-view .column-header-background .filler { 
    -fx-background-color: linear-gradient(#101010 0%, #424141 100%); 
} 

参考のために、あなたはJavaFX CSS Referenceを使用するか、またはSceneBuilderに組み込まれたCSS Analyzerツールを使用することができます。