RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v15]

Abhishek Kumar duke at openjdk.org
Wed Aug 10 04:51:44 UTC 2022


On Tue, 9 Aug 2022 19:21:03 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> > @prsadhuk I have made few changes in formatting the file size, using MessageFormat and NumberFormat to format the file size with 1 decimal place precision. Earlier JFileChooser show file size for "1.0" as "1", now it will show one decimal place precision. Empty files show as "0 KB".
> 
> If JFileChooser always shows a decimal point for nearly all files, should it show 0.0 KB for zero-sized files?
> 
> I guess it would simplify your code as there'll be no reason to change number format.

@aivanov-jdk  It will simplify the code but I checked in native file system and it shows "0 bytes" for zero-sized files. So to keep it similar to native, zero-sized files shown as "0 KB".

-------------

PR: https://git.openjdk.org/jdk/pull/9327



More information about the client-libs-dev mailing list