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

Cannot compile JFXPanel with JDK 9: SurfaceData::getDefaultScale not found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • javafx
    • None

      Compiling FX with a recent build of JDK 9 gives the following error:

      $ java -version
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+105-2016-02-10-235300.javare.4433)
      Java HotSpot(TM) Client VM (build 9-ea+105-2016-02-10-235300.javare.4433, mixed mode)

      $ gradle
      ...
      /localhome/kcr/javafx/9-kcr/jfx/rt/modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java:692: error: cannot find symbol
                      newScaleFactor = ((SunGraphics2D)g).surfaceData.getDefaultScale();
                                                                     ^
        symbol: method getDefaultScale()
        location: variable surfaceData of type SurfaceData

      This is a result of changes to the sun.java2d.SurfaceData class for Windows Hi-DPI support -- see JDK-8073320. This class used to have a getDefaultScale() method and now has separate getDefaultScaleX() and getDefaultScaleY() methods.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: