Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8096940

The text of Button and Label with Chinese character are not rendered

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8
    • javafx
    • OS :windows 7 32bit
      JDK version information:
      java version "1.8.0-ea"
      Java(TM) SE Runtime Environment (build 1.8.0-ea-b97)
      Java HotSpot(TM) Client VM (build 25.0-b39, mixed mode, sharing)
      IDE:Netbeans IDE 7.3.1

      Set the text of Button or Label with Chinese character.run the project you will find the text of the Button or the Label is blank.
      I don't not how to attach a image, so i upload the screenshot of the test application and address is http://photo.163.com/rql1986/#m=2&aid=55231305&pid=8388134988
      you can use the code below reproduce this problem:
      /*
       * To change this template, choose Tools | Templates
       * and open the template in the editor.
       */
      package javafx8testchinese;

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Label;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      /**
       *
       * @author rql1986
       */
      public class NewFXMain extends Application {
          
          @Override
          public void start(Stage primaryStage) {
              VBox vbox = new VBox();
              Button btnCN = new Button("中文按钮");
              Button btnEN = new Button("English Button");
              Label lblCN = new Label("中文标签");
              Label lblEN = new Label("English Label");
              
              
              StackPane root = new StackPane();
              vbox.getChildren().add(btnCN);
              vbox.getChildren().add(lblCN);
              vbox.getChildren().add(btnEN);
              vbox.getChildren().add(lblEN);
              root.getChildren().add(vbox);
              
              Scene scene = new Scene(root, 300, 250);
              
              primaryStage.setTitle("Hello World!");
              primaryStage.setScene(scene);
              primaryStage.show();
          }

          /**
           * The main() method is ignored in correctly deployed JavaFX application.
           * main() serves only as fallback in case the application can not be
           * launched through deployment artifacts, e.g., in IDEs with limited FX
           * support. NetBeans ignores main().
           *
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              launch(args);
          }
      }

      ADD:
      I found this problem can through the following steps to reproduce the problem:
      1.Get a PC that OS is Windows 7 Chinese version.
      2.Install JDK7u25 and NetBeans IDE 7.3.1.
      3.Install JDK8 B96.
      4.Uninstall JDK8 B96.
      5.Install JDK8 B97.
      6.Create a JavaFX project and create a JavaFX application that code like the Description of this issues, compile and run this application, you found this problem.

      I think this is the same problem with RT-31540.

        1. Chinese.JPG
          18 kB
          Yao Wang
        2. chinese.png
          10 kB
          Irina Grineva
        3. FontNameSizeApp.java
          4 kB
          Jenny Huang
        4. javafx-font.dll
          44 kB
          Felipe Heidrich
        5. log1.txt
          91 kB
          Felipe Heidrich
        6. log2.txt
          90 kB
          Felipe Heidrich
        7. log3.txt
          103 kB
          Felipe Heidrich
        8. rt31587.png
          41 kB
          Jenny Huang
        9. RT31587.txt
          4 kB
          Felipe Heidrich
        10. RT31587b.java
          4 kB
          Felipe Heidrich
        11. yahei.png
          39 kB
          Jenny Huang

            fheidric Felipe Heidrich (Inactive)
            ranqilinjfx Ranqilin (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: