how to set FileDialog's fileFilter? [message #446022] |
Tue, 16 November 2004 07:29 |
Eclipse User |
|
|
|
Originally posted by: jyzhang.superv.com.cn
I want to add such a filter in fileDialog:
JPEG compressed image files(*.jpg, *.jpeg)
but there's only this method to access fileDialog,
fileDialog.setFileExtensions(String[])
this method will add two filters in fileDialog.
how to unify them as one?
who can help me, Thanks a lot.
|
|
|
|
Re: how to set FileDialog's fileFilter? [message #446027 is a reply to message #446025] |
Tue, 16 November 2004 09:24 |
Eclipse User |
|
|
|
Originally posted by: jyzhang.superv.com.cn
HI,
thank you every much.
I have ever tried using ",", not ";". so I failed :(
fileDialog.setFilterExtensions(new String[] {"*.jpg,*.jpeg"});
thanks again, Regards
Harry
> Hi,
> With setFilterExtensions() you will set the extensions and with
> setFilterNames() the correspondent filter names.
> fileDialog.setFilterExtensions(new String[] {"*.jpg;*.jpeg"});
> fileDialog.setFilterNames(new String[] {"JPEG images"});
> If you need more filters just put the in the String array.
> Regards,
> Boby
|
|
|
Powered by
FUDForum. Page generated in 0.04182 seconds