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

ScrollPane is Empty When Maximizing Window

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u45
    • Fix Version/s: 7u55
    • Component/s: javafx
    • Environment:

      Windows 7
      java version "1.7.0_45"
      Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
      Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)

      Description

      Java FX ScrollPane is empty when the window is maximized and the minimum size of the ScrollPane content is bound to both horizontal and vertical viewport bounds, and the content is too large to fit in the non-maximized window (scroll bars visible), but small enough to fit in the maximized window (no scroll bars).

      To reproduce:

      1) Build and run the attached test case: ScrollPaneMaximizeBug.java (no build/runtime options used)
      2) Scroll to the middle of the viewport.
      3) Maximize the window.
      4) Observe that the scroll pane is now empty.

      Notes:
        1) The application is written to expose the bug on the specific screen resolution of 1920x1080. If your screen resolution (specifically vertically) is different, you may need to adjust the number of rows in the VBox.

        2) The bug is only exposed when the content is large enough that you are able to see a scrollbar in the non-maximized state, but is small enough that you are not able to see a scrollbar in the maximized state.

        3) The bug is only exposed when binding the minimum size of the scrollpane content to the viewport bounds of the scrollpane. If you bind only in the vertical or the horizontal direction, exclusive, it does not reproduce. It is only when you bind in both directions.


      Also, note that you get different behavior, depending on the degree that the scrollbar is scrolled before resizing (maximizing) the window. For example, if you scroll vertically only very very slightly (i.e. so that the "0" element is only half visible), and then maximize the window, you will see the window content is visible but has an incorrect vertical offset.

      Based on the fact that the behavior changes depending on the degree that the scrollbar is scrolled before resizing, and the fact that it depends on the size of the content vs the size of the scrollpane before/after the window resize, it would seem that this is a layout problem within the scrollpane hierarchy. Maximizing isn't the actual problem, it just happens to be the easiest way to reproduce the bug, as it creates a large instantaneous jump in the size of the scrollpane.

        Attachments

          Activity

            People

            • Assignee:
              dmarkov Dmitry Markov
              Reporter:
              spayne Sandra Payne
            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:
                Imported: