Re: alphabetically arranging combobox entries
From: Stefan Waldmann (stefan.k.waldmann_at_vr-web.de)
Date: 06/24/04
- Next message: Bc.: "Return character"
- Previous message: Ding Lei: "Need help on math computation with java"
- In reply to: V S Rawat: "alphabetically arranging combobox entries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 24 Jun 2004 11:21:34 +0200
V S Rawat wrote:
> In my code (given below), I am getting the list of files
> with a particular extension, and adding their filename
> (wihtout extension) to a JCombobox.
>
> It is working but the combobox entries are not appearing
> alphabetically sorted.
>
> Is it possible to pick the filenames in sorted order, or to
> make them appear alphabetically in the combobox?
>
> In what order is it getting the list of files from dos (in
> win98SE)? createdOn? lastModified, lastAccessed? or what?
>
> Is there dos/window utility which can arrange files in that
> physical order in a folder? There was some norton utility I
> had accessed ages ago that was able to do this.
Hi,
I wouldn't rely on OS functions. (Who wants to be platform dependent? ;-)
Just do the sorting yourself in your application.
Collect your file names in an Array or List first, and sort them using
Arrays.sort(...) or Collections.sort(...) before you add them to your
combobox.
HTH
Regards,
Stefan
- Next message: Bc.: "Return character"
- Previous message: Ding Lei: "Need help on math computation with java"
- In reply to: V S Rawat: "alphabetically arranging combobox entries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|