RFR: 8139228: JFileChooser renders file names as HTML document [v3]

Alexey Ivanov aivanov at openjdk.org
Wed May 21 12:08:59 UTC 2025


On Mon, 19 May 2025 13:52:16 GMT, Tejesh R <tr at openjdk.org> wrote:

>> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified.
>> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name.
>
> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review fix

test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 43:

> 41: 
> 42:     public static void main(String[] args) throws Exception {
> 43:         String INSTRUCTIONS = """

Please make `INSTRUCTIONS` a `private static final` field at the top of the class. This is the most common way in tests, and it'll make the `main` method cleaner especially after adding additional logic for switching Look-and-Feels as I [suggested in a discussion thread](https://github.com/openjdk/jdk/pull/24439#discussion_r2100110185).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100116456


More information about the client-libs-dev mailing list