Re: Adding encoding selection to JFileChooser



Natasha Lloyd wrote:
I have been reading and reading about this topic, but I can't seem to
find a good way that I can add encoding selection to JFileChooser.

In my application, the user needs to be able to load/save files in any
encoding. My first thought was to do automatic detection of encoding
when they open a file, but even if that were possible, they still need
to be able to specify the encoding when saving a file they modified in
my app.

I know you can set the accessory for JFileChooser, but that would look
really ugly if all I want is a JComboBox listing the encodings.

I also know you can overwrite the createDialog() method to add
something to the "SOUTH" region of the dialog, but I'm using the
Windows LAF, so the added component ends up below the "shortcut"
buttons on the left (Desktop, My Documents, etc) and also looks ugly.

What I would ideally like to do is just add a third drop-down option
below the file type selector. Is this possible? Does anyone have any
ideas?

Thanks in advance!

- Natasha -


The Mozilla CharDet library gives a pretty good guess as to the encoding used in the file, for what it is worth.

Rogan
.