Hi all,
i am using fileChooser to find a file and save the address to a String. how can i get just the extension of the file?
i tried with a conjuction of subString and indexOf, but if there are more than one '.' on the address i get the wrong substring. obviously i cant just say
subString(length-4,length);
cos for files with more than 3 characters on the extensions, such as *.java, will not work.
any help?
also, is it possible to set the home directory on the fileChooser window? it always opens on the "my documents" directory (for windows at least) even though the file is on a subfolder
cheers
i am using fileChooser to find a file and save the address to a String. how can i get just the extension of the file?
i tried with a conjuction of subString and indexOf, but if there are more than one '.' on the address i get the wrong substring. obviously i cant just say
subString(length-4,length);
cos for files with more than 3 characters on the extensions, such as *.java, will not work.
any help?
also, is it possible to set the home directory on the fileChooser window? it always opens on the "my documents" directory (for windows at least) even though the file is on a subfolder
cheers