public void setFileName( String fn )
    {
        this.fileName.setText( fn );    //set filename

        //determine file type
        int index = fn.indexOf(".");
        fn = fn.substring( index+1 );
        if( fn.equalsIgnoreCase( "bmp" ) )
            this.fileType.setText( "Bitmap (.bmp)" );
        else if( fn.equalsIgnoreCase( "gif" ) )
            this.fileType.setText( "Graphics Interchange Format (.gif)" );
        else if( fn.equalsIgnoreCase( "jpeg" ) || fn.equalsIgnoreCase( "jpg" ) )
            this.fileType.setText( "JPEG (." + fn + ")" );
        else  if( fn.equalsIgnoreCase( "pgm" ) )
            this.fileType.setText( "PGM (.pgm)" );
        else this.fileType.setText( "PPM (.ppm)" );

    }