<Swing Dev> SVG support for Swing icons etc.? (Useful for HiDPI)

Eirik Bakke ebakke at ultorg.com
Thu Sep 22 17:10:04 UTC 2016


Hi, swing-dev.

I see there's a lot of work going on to make Swing work well with HiDPI/Retina displays, including the new MultiResolutionImage API ( http://openjdk.java.net/jeps/251 ).

It's now up to application developers to provide icons and other image assets in multiple resolutions. My bet is that many of these newly designed assets are going to be designed as vector art (e.g. Adobe Illustrator), which will currently need to be manually rasterized down to PNG files of the different required resolutions.

Are there any plans or existing RFEs for allowing Swing to load SVG files from its existing APIs (e.g. "new ImageIcon(URL)")? I searched the OpenJDK JIRA and JEP 251 but could not find any mention of this. I think SVG support would make it easier for application developers to supply icons that look good at all resolutions. SVG support is now standard in all the big web browsers.

Some existing approaches involving use of the external Batik library can be seen on http://stackoverflow.com/questions/2495501/swing-batik-create-an-imageicon-from-an-svg-file .

-- Eirik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20160922/e86a8b4c/attachment.html>


More information about the swing-dev mailing list