- Timestamp:
- 2012-07-24T23:14:52+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r5114 r5358 5 5 6 6 import java.awt.Color; 7 import java.awt.Toolkit; 7 8 import java.io.BufferedReader; 8 9 import java.io.File; … … 28 29 import java.util.Map; 29 30 import java.util.Map.Entry; 30 import java.util. Properties;31 import java.util.ResourceBundle; 31 32 import java.util.SortedMap; 32 33 import java.util.TreeMap; … … 52 53 import org.openstreetmap.josm.tools.ColorHelper; 53 54 import org.openstreetmap.josm.tools.Utils; 54 import org.openstreetmap.josm.tools.XmlObjectParser;55 55 56 56 /** … … 1439 1439 */ 1440 1440 public void updateSystemProperties() { 1441 Properties sysProp = System.getProperties(); 1442 sysProp.put("http.agent", Version.getInstance().getAgentString()); 1443 System.setProperties(sysProp); 1441 updateSystemProperty("http.agent", Version.getInstance().getAgentString()); 1442 updateSystemProperty("user.language", Main.pref.get("language")); 1443 // Workaround to fix a Java bug. 1444 // Force AWT toolkit to update its internal preferences (fix #3645). 1445 // This ugly hack comes from Sun bug database: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6292739 1446 try { 1447 Field field = Toolkit.class.getDeclaredField("resources"); 1448 field.setAccessible(true); 1449 field.set(null, ResourceBundle.getBundle("sun.awt.resources.awt")); 1450 } catch (Exception e) { 1451 // Ignore all exceptions 1452 } 1453 } 1454 1455 private void updateSystemProperty(String key, String value) { 1456 if (value != null) { 1457 System.setProperty(key, value); 1458 } 1444 1459 } 1445 1460
Note:
See TracChangeset
for help on using the changeset viewer.