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

[macosx] [hidpi] multiresolution icon: should naming convention work when using getResourceAsStream()?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 9
    • client-libs

      Not sure if a bug, but just in case.

      Env.: JDK9 b108 + OS X 10.10.5 + retina

      Please save run the attached test and icons to the same folder, run the test.
      The left icon is low-res. (blue), the right is high-res. (green).

      Should the naming convention work when using getResourceAsStream()?

      Please note that the following construction will work properly (two green icons, as expected):

        Image img1 = Toolkit.getDefaultToolkit().getImage(getClass().getResource("icon.jpg"));
        ...
        b1.setIcon(new ImageIcon(img1));

        1. ResourceTest.java
          1 kB
        2. icon@2x.jpg
          icon@2x.jpg
          1 kB
        3. icon.jpg
          icon.jpg
          0.8 kB

            alexsch Alexandr Scherbatiy
            avstepan Alexander Stepanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: