private void loadImage(ParticleEmitter emitter) { final String imagePath = emitter.getImagePath(); String imageName = new File(imagePath.replace('\\', '/')).getName(); try { FileHandle file; if (imagePath.equals("particle.png")) file = Gdx.files.classpath(imagePath); else file = Gdx.files.absolute(imagePath); emitter.setSprite(new Sprite(new Texture(file))); } catch (GdxRuntimeException ex) { ex.printStackTrace(); EventQueue.invokeLater( new Runnable() { public void run() { JOptionPane.showMessageDialog( ParticleEditor.this, "Error loading image:\n" + imagePath); } }); emitter.setImagePath(null); } }