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

Make fitWidth of ImageView stylable as fit-width

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • 8u60
    • javafx

    Description

      In JavaFx you can set the fitWidth of an image view programmatically to resize the image shown to match the resolution and size of the current user's monitor. However, you cannot express the desired fitWidth with CSS. Some people are using background images instead of imageView as a work around but this is not always convenient.

      I suggest introducing two CSS properties fit-width and fit-height allowing me to write the following CSS for a button which uses an ImageView as its graphic.

      .myButton .imageView {
         -fx-fit-width: 30;
         -fx-fit-height: 30;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: