You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have TextArea with text which length is, for example, 120 characters. And I need to lock text from the beginning to position 100. I mean that the user should not be able to do anything with the text in the range 0-100.
In my situation it is very difficult to work with textArea.addEventFilter(KeyEvent.KEY_PRESSED,...) because there are menu item accelerators that can be configured via settings. So, I thought, maybe it is possible on text area low level API somehow to catch text change events and block them.
Could anyone help me?
The text was updated successfully, but these errors were encountered:
@Jugen Thank you very much. I tested this solution and I think I will use it.
However, I noticed an interesting thing. When you try to paste any text NOT FROM this text area(for example, from you IDE), using Ctrl+V or Shift+Ins then you can block this text modification in replaceText. However, if you copy text FROM this text area and paste it, using same keys, it is inserted without any problems and replaceText is not called.
I have TextArea with text which length is, for example, 120 characters. And I need to lock text from the beginning to position 100. I mean that the user should not be able to do anything with the text in the range 0-100.
In my situation it is very difficult to work with textArea.addEventFilter(KeyEvent.KEY_PRESSED,...) because there are menu item accelerators that can be configured via settings. So, I thought, maybe it is possible on text area low level API somehow to catch text change events and block them.
Could anyone help me?
The text was updated successfully, but these errors were encountered: