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

Scene: Allow to add a stylesheet using a typed URL, not a stringified URL

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      All platforms.

      A DESCRIPTION OF THE PROBLEM :
      Currently a JavaFX javafx.scene.Scene allows to add the URL of a stylesheet only in its external, stringified form (via #getStylesheets().add( "..." ); ).

      But in some cases URL instances hold internal state like an URLStreamHandler that is lost if the URL is converted to its stringified form. Such URL instances are for example returned from java.lang.Class#getResource if specialized class loaders are installed -- like class loaders that offer support for special jar strcutures.

      The symptom is that URL#openStream on the original URL from the Classloader works, but the Scene cannot load the Stylesheet because in the conversion URL -> externalForm -> URL the URLStreamHandler was lost.

      Better would be if a Stylesheet URL instance could be directly attached and used by a scene, without intermediate conversion.



        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: