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

Abhishek Kumar duke at openjdk.org
Thu Jul 28 16:18:37 UTC 2022


On Thu, 28 Jul 2022 16:09:37 GMT, Abhishek Kumar <duke at openjdk.org> wrote:

>> also, it always formats numbers to have one decimal point, even for whole numbers (10.0)
>> is this intended functionality?  should "0.#" be used instead?
>
> Group separator may come into picture if file size is in terms of TB, otherwise for files having sizes in bytes , KB, MB and so on will be converted to next higher unit if size > 999.
> 
> e.g. 
> 1000 bytes - 1KB
> 1000 KB - 1 MB and so on...
> 
> So, I guess group separator may not come into play.

> also, it always formats numbers to have one decimal point, even for whole numbers (10.0) is this intended functionality? should "0.#" be used instead?

JFileChooser is not showing one decimal point for whole numbers. 
e.g. 1000 KB file is shown as 1 MB. 

![image](https://user-images.githubusercontent.com/107542245/181587024-b05786c6-2c92-4230-9fb2-bcb5fdda1082.png)

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

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



More information about the client-libs-dev mailing list