2011-12-17 29 views
0

我想在我的JavaFx 2.0應用程序中創建類似Opera網絡瀏覽器的選項卡。我試圖用許多CSS設置來定製選項卡,但沒有成功。有誰知道如何做到這一點?在javafx中創建類似opera的選項卡

+0

你能否解釋一下「像歌劇「終端?他們有幾個變種。 – 2011-12-18 11:14:33

回答

2

您可以將類添加到一個單獨的標籤樣式,就像這樣:

.blue .tab-label { 
    -fx-text-fill: blue; 
} 

.red .tab-label { 
-fx-text-fill: red; 
} 

.green .tab-label { 
-fx-text-fill: lime; 
} 

和樣式的所有選項卡,你可以用這樣的CSS:

.tab-chat.tab:hover { 
-fx-background-color: linear-gradient(to top, -fx-purple, -fx-control-inner-background); 
} 

.tab-chat:selected { 
-fx-background-color: linear-gradient(to bottom, derive(-fx-base, 95%),  -fx-control-inner-background); 
-fx-background-insets: 0, 9 9 0 9; 
-fx-background-radius: 12 12 0 0, 12 12 0 0; 
-fx-font-weight: bold; 
} 

/* ----------------------------- */ 
/* Tabs background graphic  */ 
/* ----------------------------- */ 
.tab-header-background { 
    -fx-background-image: url("images/back-rustyfill.jpg"); 
} 
相關問題