locale - Detecting when OS language is changed - Java -


i'm coding fullscreen bilingual app in java. fullscreen means, language bar below desktop hidden user, and... need it! so, how can reproduce programmatically?!
strictly speaking, need know, current os language is, when change language event occurs, and, way set when needed.
how should task done?
thanks!

get os language:

system.getproperty("user.language"); 

set os language:

system.setproperty("user.language","..."); //... = language want set 

if want change language inside program, via combobox or something, add actionlistener component , use set method mentioned before set language. system.setproperty("user.language",yourcombobox.gettext()); can set language inside program simple if-statements.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -