On Wed, 26 Jul 2023 03:26:02 GMT, Prasanta Sadhukhan <[email protected]> wrote:
> > The bug report mentions using `setDocument()` to change the value of the > > formatted text field. Also, it's possible to call > > `getDocument().setText()`, which may still have the original bug. > > Fixed setDocument but I couldn't find Document.setText that can be called... Sorry about it, `Document` uses `insertString` method. Perhaps, we shouldn't care about it, if you modify the text using the `Document` interface directly, you could lose the invariants that `JFormattedTextField` provides. The [javadoc](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/JFormattedTextField.html) also mentions, that you should not install your own `DocumentFilter` and `NavigationFilter`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/14993#issuecomment-1656235954
