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

Cannot use large Canvas as ScrollPane content

    XMLWordPrintable

Details

    • x86
    • windows_10

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0_121"
      Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      WIndows Version 10.0.14393

      A DESCRIPTION OF THE PROBLEM :
      App has a ScrollPane that rougly occupied 1/4 of Scene. The latter is 1670w x 1000h. The App has several controls over the Scene (in child containers).

      Attempts to set the ScrollPane with a large Canvas causes NPEs and results in a blank Scene. Reduce the Canvas size, and all is well.

      The problem is that the Canvas is being used to hold representations of music tracks, and once the track has enough bars, the Canvas needs widening to accomodate. But initial investigation, setting the Canvas bigger in th first place, causes this bug to show up, making the app non-viable for shipping.

      In short, this is DISASTROUS.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Depending on canvas width, this causes application to fail to render anything. Just get a blank window.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A canvas that can be scrolled
      ACTUAL -
      Blank scene

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      NPE
      at com.sun.javafx.sg.prism.NGCanvas$RenderBuf.validate(NGCanvas.java:213)
      at com.sun.javafx.sg.prism.NGCanvas.initCanvas(NGCanvas.java:640)
      at com.sun.javafx.sg.prism.NGCanvas.renderForcedContent(NGCanvas.java:624)
      at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
      at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
      at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
      at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
      at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
      at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
      at com.sun.javafx.sg.prism.NGGroup.renderForcedContent(NGGroup.java:198)
      at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:332)
      at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
      at java.lang.Thread.run(Thread.java:745)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      ScrollPane initial size set in SceneBuilder: width 665, height 200: The ScrollPane is a child of AnchorPane, 1670w x 1000h

              private void configureCanvas(boolean remember, ScrollPane pane,
      Canvas c) {
      c.setHeight(pane.getHeight() * 4);
      c.setWidth(pane.getWidth() * 8);
      pane.setContent(c);
      }

      Change 8 to 20, and the app is ruined.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Restrict size. MAkes app useless at that point, App cannot be released.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: