Module xaos.ui

Class ResourceUtils


  • public class ResourceUtils
    extends Object
    Utilities to load resources from the module/class path.
    Author:
    claudio.rosati@esss.se
    • Method Detail

      • getImage

        public static Image getImage​(String resource)
        Parameters:
        resource - The string representing the URL to use in fetching the pixel data. In case of a resource file a simple "/path/to/resource.ext" string is sufficient. The modules whose code uses this method must open the corresponding package to the xaos.ui module.
        Returns:
        The Image loaded from the given resource path or null if the resource doesn't exist or cannot be loaded, in which case a severe message is logged.