Opened 11 years ago

Last modified 11 years ago

#8342 closed defect

Some images (plus, minus, bing) are not referenced properly for JAR use — at Initial Version

Reported by: The111 Owned by: The111
Priority: normal Milestone:
Component: JMapViewer Version: latest
Keywords: Cc:

Description

The loading and error images are reference as follows:

LOADING_IMAGE = ImageIO.read(JMapViewer.class.getResourceAsStream("images/hourglass.png"));
ERROR_IMAGE = ImageIO.read(JMapViewer.class.getResourceAsStream("images/error.png"));

This is a good thing, since if somebody uses the JMV release JAR file in an application, these images can still be found through the JMapViewer.class reference.

However, the plus, minus, and bing images are referenced as follows:

ImageIcon icon = new ImageIcon(getClass().getResource("images/plus.png"));

The problem with this is that if somebody uses the JMV release JAR in their application, and creates a subclass of JMV, that class will not be able to find the path "images/" if it has a different package. Thus it is probably smart to change these references to the same style as the earlier ones, like this:

ImageIcon icon = new ImageIcon(JMapViewer.class.getResource("images/plus.png"));

Change History (0)

Note: See TracTickets for help on using tickets.