JavaFX TextInputControl private access yet supposed to be overrided problem
tom L
tom_L64 at hotmail.com
Fri Jul 25 18:02:47 UTC 2025
Hello.
I have this problem where a lot of methods and utility in TextInputControl have package private access while at the same time are expected to be used/overriden by children.
For example,
```
String filterInput(String text) {
// This method should be overridden by child classes.
// It is overridden in TextField and TextArea as needed.
return text;
}
```
This method is clearly supposed to be overriden, and I am making a hex editor, requiring me to create my own text field, but I can't override it.
It is the same for other methods, also including utility methods, like for example, with the same name :
```
static String filterInput(String txt, boolean stripNewlines, boolean stripTabs)
```
In order to do what I want, I am no choice but to copy paste half the code of this class, since even if I override the only method that uses filterInput, public void replaceText, there are a lot of package private stuff inside (mainly getFormatterAccessor), so I am ended up with trying to copy paste the whole class.
On another note, since I am talking about formatter accessor, this inner class in TextInputControl has a typos in it: TextInputControlFromatterAccessor.
Is it possible to fix this?
Thank you in advance.
Best regards,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20250725/fdeac679/attachment.htm>
More information about the openjfx-dev
mailing list