Resolved issue with loading 'loading.png' image file for the map

This commit is contained in:
denny
2016-01-15 09:49:43 -05:00
parent ab9ef2d8cc
commit 5807bb191e

View File

@@ -22,10 +22,9 @@ import java.awt.image.BufferedImage;
import java.beans.DesignMode;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.net.URL;
import java.util.Set;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import org.jdesktop.swingx.mapviewer.GeoPosition;
@@ -126,13 +125,13 @@ public class JXMapViewer extends JPanel implements DesignMode
// make a dummy loading image
try
{
URL url = JXMapViewer.class.getResource("mapviewer/resources/loading.png");
this.setLoadingImage(ImageIO.read(url));
ImageIcon imageIcon = new ImageIcon( "images/loading.png" );
this.setLoadingImage( imageIcon.getImage() );
}
catch (Throwable ex)
{
mLog.error( "JXMapViewer could not load 'loading.png'" );
mLog.error( "could not load 'loading.png'" );
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = img.createGraphics();