Reputation: 4128
I am trying to have two JavaFX TextField
s, one which takes input using a standard English keyboard/language, and the other using a Japanese keyboard/language.
This answer addresses the problem for Swing, but the JavaFX TextField
doesn't have the needed getInputContext()
method.
My plan was to either catch a focus event and change the Locale
to Japanese, or associate a specific Locale
with the Japanese TextField
. However, I don't know how to actually achieve either of these.
I have a suspicion the Java Input Method Client API may be needed.
I am using Windows 8, but it would be nice to have a OS independent answer.
Upvotes: 0
Views: 1708
Reputation: 20565
The only thing that comes close that i could find was:
textfield.getText().regionMatches();
however im not sure that this is the one your looking for.
Update
i also found
txt_message.getText().format(Locale.JAPANESE, format, args)
Upvotes: 0