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

Image URL for a local file doesn't behave the on Linux and on Windows

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: fx1.2.1
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      jpg file on local disk

      Description

      Loading a image file from the disk doesn't work the same under Linux than on Windows
      Linux needs one more / Windows doesn't work with two //

      Windows: url: file:/ [localpath for picture]
      Linux: url: file:// [localpath for picture]

      Real life example in my application:

      img = Image {
      url: "file://home/suvi/NetBeansProjects/viewfx/src/viewfx/pictures/pic2.jpg" // file:// works only on linux
      //url: "file:/D:/My Documents/NetBeansProjects/ViewFX/src/viewfx/pictures/pic2.jpg" // file:/ works only on windows
      //url: "{_DIR_}pictures/pic2.jpg" //works on both windows and linux
      };

      at the end i am loding the file like this

              img = Image {
                  url: "file:/{images[0]}"
                }

      No workaround so far. I need at least a workaround that my application would work. A separete windows, linux version would not be nice at all, also not in the spirit of java.

        Attachments

          Activity

            People

            • Assignee:
              kcr Kevin Rushforth
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: