private void browseForImage ( ) { if ( emitter != null ) { int resp = chooser . showOpenDialog ( this ) ; if ( resp == JFileChooser . APPROVE_OPTION ) { File file = chooser . getSelectedFile ( ) ; String path = file . getParentFile ( ) . getAbsolutePath ( ) ; String name = file . getName ( ) ; ConfigurableEmitter . setRelativePath ( path ) ; emitter . setImageName ( name ) ; imageName . setText ( name ) ; } } }
Browse for a particle image and set the value into both the emitter and text field on successful completion