On Tue, 28 Apr 2026 22:48:58 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Can you clarify which setter and which reference you're referring to?
>
> "JEditorPane.setEditorKit" and "JTextComponent.setDocument()"

I think `JEditorPane.setEditorKit` is the uninteresting case, because it calls 
`setDocument`.

I drafted a new approach that overrides `JEditorPane.setDocument`. Would you 
prefer 
[this](https://github.com/openjdk/jdk/compare/master...mickleness:8380790D?expand=1)?

The PR on this page proposes lazily uninstalling the cached hypertext object 
when someone calls `accessibleContext.getAccessibleText()`.

The new `8380790D` branch proposes uninstalling the cached hypertext object 
when `setDocument` is called; this relies on asking JEditorPane to check `if 
(accessibleContext instanceof AccessibleJEditorPaneHTML)` to identify this 
specific scenario.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30401#discussion_r3157961193

Reply via email to