2016-08-19 8 views
0

내 스크린 샷 참조 일반 텍스트로 설정하는 방법, 굵게, 팝업 글꼴 및 일반 라벨 글꼴이 여기자바 FX 팝업 글꼴

enter image description here

그들이 동일하게하는 방법, 사랑하는 것은 내 코드입니다 :

class TestPopupTextBoldBug extends Application { 
    @Override 
    void start(Stage stage) throws Exception { 
     VBox root = new VBox() {{ 
      children.add(new Label("here is normal text")) 
     }} 
     Popup pp = new Popup() 
     pp.content.add(new VBox() { 
      { 
       children.add(new Label("here is popup text")) 
      } 
     }) 
     Scene scene = new Scene(root, 800, 600) 
     stage.setScene(scene) 
     stage.show() 
     pp.show(stage) 
    } 
} 
+0

이 레이블 CSS 스타일링 시도? [http://code.makery.ch/library/javafx-8-tutorial/part4/](http://code.makery.ch/library/javafx-8-tutorial/part4/) – jwpfox

답변

0

차이점이 나타나는 이유는 팝업 메뉴의 레이블에 배경색이 없기 때문입니다.

레이블에 부모로 추가 한 VBox는 투명 배경입니다.

당신은 CSS를 사용하여 배경 색상을 추가 할 수 있습니다

vbox.setStyle("-fx-background-color:white;");