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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      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

      Description

      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.

        Attachments

        1. Chinese.JPG
          Chinese.JPG
          18 kB
        2. chinese.png
          chinese.png
          10 kB
        3. FontNameSizeApp.java
          4 kB
        4. javafx-font.dll
          44 kB
        5. javafx-runtime-for-cobundle.zip
          5.87 MB
        6. jfxrt.jar
          8.17 MB
        7. log1.txt
          91 kB
        8. log2.txt
          90 kB
        9. log3.txt
          103 kB
        10. rt31587.png
          rt31587.png
          41 kB
        11. RT31587.txt
          4 kB
        12. RT31587b.java
          4 kB
        13. yahei.png
          yahei.png
          39 kB

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported: