JavaFx jar文件tableView样式属性在创建jar时不起作用?

时间:2016-09-22 13:40:00

标签: css javafx jar tableview netbeans-7

我正在使用Netbeans为我的FX应用程序创建一个jar,应用程序在独立jar中正常运行。但是tableview列标题和某些字体的样式属性不起作用。

我已经使表格视图透明,但是在jar中它也是灰色的,字体也会变化。

Application while running from Netbeans

Application when running from standalone jar

这是我在应用程序中的CSS文件

.button {
-fx-font-size: 13.0px;
-fx-font-weight:bold;
-fx-base: #00a7d4;
-fx-background: #e5f3f6;
-fx-focus-color: #0093FF;
-fx-control-inner-background: #FFFFFF;
-fx-text-base-color: #FFFFFF;
-fx-background-color: transparent;
-fx-inner-border: linear-gradient(to bottom, derive(-fx-color,73.6%) 0%, derive(-fx-color,29.200000000000003%) 100%);
-fx-body-color: linear-gradient( to bottom, derive(-fx-color, 34.0%) 0%, derive(-fx-color, -18.0%) 100%);
-fx-background-insets: 0px;
-fx-border-radius: 10;
-fx-background-radius: 10;
-fx-border-color:black;
-fx-padding: 0.166667em 0.833333em 0.25em 0.833333em; /* 2 10 3 10 */
/*-fx-text-fill: -fx-text-base-color;*/
-fx-alignment: CENTER;
-fx-content-display: LEFT;
}

.button:focused {
-fx-color:#00a7d4;
-fx-background-color:transparent;
-fx-background-insets: -1.4, 0, 1, 2;
-fx-border-radius: 10;
-fx-background-radius: 10;;
}

.button:hover {
-fx-focus-color: #FF0000;
-fx-background-color: #b3ffb3;
-fx-border-radius: 10;
-fx-background-radius: 10;
}

.root {
 -fx-background-image: url("/images/back.jpg");
  -fx-background-radius: 10 ;

}

#AOLtable .table-cell{
    -fx-alignment: CENTER;
    -fx-font-weight:bold;
}

#back {          
    -fx-graphic: url("/images/Backward.png");
    -fx-graphic-text-gap : 10;
}

.tab-pane *.tab-header-background
{
-fx-background-color: transparent;
}

#Content{
  -fx-background-image: url("/images/back.jpg");
}
.table-view {
    -fx-background-color: transparent;
    -fx-background-insets: 0;
    -fx-padding: 10;
    -fx-alignment: center;
}
.table-view .column-header-background {
    -fx-background-color: transparent;
    -fx-border-color: transparent transparent rgba(255,255,255,0.3) transparent;
    -fx-border-width: 1;
    -fx-background-insets: 0;
    -fx-padding: 0 10 0 0;
}
.table-view .column-header, .table-view .filler {
    -fx-border-color: transparent;
}
.table-view .column-header .label {
    -fx-text-fill: firebrick;
    -fx-font-weight: bold;
}
.table-view .table-cell {
    -fx-background-color: transparent;
    -fx-border-color: transparent;
    -fx-text-fill: black;
    -fx-alignment: center;
}
.table-view  .table-row-cell:filled:selected:focused,
.table-view  .table-row-cell:filled:selected {
    -fx-background-color: rgba(0,0,0,0.3);
}



.table-view .table-row-cell {
    -fx-background-color: transparent;
   /* -fx-border-color:black;*/

}

请帮忙,因为我无法弄清楚出了什么问题。 由于其他组件正在工作,为什么只有javaFX的tableView列标题不起作用。

我尝试在tuw fxml本身添加表视图css文件,而不是从java代码中添加它,但问题仍然存在,这不是错误,但css会受到一些影响。我还制作了一个演示应用程序,看看这个应用程序的bug还是什么,但是那个也有相同的表视图外观请帮助

Project Structure

0 个答案:

没有答案