mocobeta commented on a change in pull request #567: URL: https://github.com/apache/lucene/pull/567#discussion_r775124417
########## File path: lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ImageUtils.java ########## @@ -19,18 +19,19 @@ import java.awt.Image; import javax.swing.ImageIcon; +import org.apache.lucene.luke.app.desktop.LukeMain; /** Image utilities */ public class ImageUtils { - private static final String IMAGE_BASE_DIR = "org/apache/lucene/luke/app/desktop/img/"; + private static final String IMAGE_BASE_DIR = "img/"; public static ImageIcon createImageIcon(String name, int width, int height) { return createImageIcon(name, "", width, height); } public static ImageIcon createImageIcon(String name, String description, int width, int height) { - java.net.URL imgURL = ImageUtils.class.getClassLoader().getResource(IMAGE_BASE_DIR + name); + java.net.URL imgURL = LukeMain.class.getResource(IMAGE_BASE_DIR + name); Review comment: Actually, the resource path does not have the corresponding package in the source folder. So it could be better to remove this "img" folder and move all image files under "org/apache/lucene/luke/app/desktop/util"? Then they can be accessed from ImageUtils like the font file. ``` // FontUtil private static final String TTF_RESOURCE_NAME = "ElegantIcons.ttf"; InputStream is = FontUtils.class.getResourceAsStream(TTF_RESOURCE_NAME); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org