FOLLOW ME Twitter Facebook Вконтакте LinkedIn RSS Feed

Java IconLoader library

IconLoader is a simple and powerful Java library for loading and displaying icons (images). Different pieces of IconLoader were ported from IntelliJ Platform to become a single library. I’d like to thank all my colleagues in the IntelliJ IDEA team for the outstanding contribution. IconLoader is a free and open source library. It main features include:

  • Simple API:  IconLoader.getIcon(“/icons/image.png”); 
  • Support HiDPI icons. This means your icons will look awesome on Retina devices. All you need to do is add a double size image next to the normal one and add @2x to its name. Say, image.png and image@2x.png Keep your code clean and simple!  IconLoader.getIcon(“/icons/image.png”);  will load the icon appropriate for the current runtime environment. HiDPI support works fine with Apple and Oracle JREs.
  • Ability to postpone image loading
  • Part of IntelliJ Platform. Meaning it’s been thoroughly tested.
  • Resources with the same path but different classloaders are supported. For example, if your application loads plugins, extensions, modules, etc. using different classloaders, then all these parts can use IconLoader for conflict-free resource loading.
  • Supports dark iconsets. If your application has dark and light themes, you will probably want to have different icons for these themes. IconLoader supports _dark suffix in filenames to load the appropriate icons. Use  IconLoader.setUseDarkIcons(true);  to force dark icons loading. Dark icons should have filenames like these: image_dark.png and image@2x_dark.png
  • Open Sourced under Apache 2.0 license. Contribute to IconLoader on GitHub

To build the library open the project in IntelliJ IDEA and perform Build -> Build Artifacts

Download IconLoader