2011-12-17 2 views
0

JavaFx 2.0 App에서 Opera 웹 브라우저와 같은 탭을 만들고 싶습니다. 많은 CSS 설정으로 탭을 사용자 정의하려했지만 성공하지 못했습니다. 아무도 그렇게하는 법을 알고 있습니까?javafx에서 오페라와 같은 탭 만들기

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

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

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

그리고이 같은 CSS 사용할 수있는 모든 탭의 스타일을 :

개별 탭에 클래스를 추가 할 수 있습니다
+0

당신이 정교한를 " 오페라 "탭과 같은 탭? 몇 가지 변종이 있습니다. –

답변

2

은 다음과 같이, 그 스타일을

.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"); 
}