2016-07-30 2 views
2

CSS 스타일 시트를 사용하여 javafx 스피너 스타일을 변경하려고합니다.CSS를 사용하여 javafx 스피너 버튼 스타일 변경

그러나 색상을 변경할 때 텍스트 필드의 색상과 화살표 버튼을 회 전자의 측면으로 만 변경할 수 있습니다. 여전히 기본값처럼 보입니다.

어떻게하면이 버튼의 색상을 변경할 수 있습니까?

답변

2

을 설정 버튼의 배경으로 사용되는 -fx-body-color :

.spinner .increment-arrow-button, 
.spinner .decrement-arrow-button { 
    -fx-body-color: yellow; 
} 

.spinner .increment-arrow-button:hover, 
.spinner .decrement-arrow-button:hover { 
    /* interpolate color between yellow and red based on first color brightness */ 
    -fx-body-color: ladder(#444, yellow 0%, red 100%); 
} 

.spinner .increment-arrow-button:hover:pressed, 
.spinner .decrement-arrow-button:hover:pressed, 
.spinner .increment-arrow-button:pressed, 
.spinner .decrement-arrow-button:pressed { 
    /* interpolate color between yellow and red based on first color brightness */ 
    -fx-body-color: ladder(#AAA, yellow 0%, red 100%); 
} 

사람들은 버튼의 배경 색상과 같은 기본 스타일 시트에 의해 사용됩니다.

+0

고마워요! 실제로 화살의 색을 어떻게 바꾸겠습니까? 버튼을 어둡게 만들 때 화살표 아이콘 사이의 대비가 충분하지 않습니다. – FrancisG

+0

걱정하지 마세요. 문제는 javafx CSS 참조 가이드를 올바르게 해석하지 못했기 때문에 도움을 주셔서 감사합니다. – FrancisG

관련 문제