We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 908d8b7 commit db04a57Copy full SHA for db04a57
sources/net.sf.j2s.java.core/src/java/awt/Color.java
@@ -785,12 +785,13 @@ public static Color getColor(String nm) {
785
* @since JDK1.0
786
*/
787
public static Color getColor(String nm, Color v) {
788
- Integer intval = Integer.getInteger(nm);
789
- if (intval == null) {
790
- return v;
791
- }
792
- int i = intval.intValue();
793
- return new Color((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF);
+ // SwingJS does not support System.getProperty for colors.
+ try {
+ int i = Integer.decode(nm);
+ return new Color((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF);
+ } catch (NumberFormatException e) {
+ return v;
794
+ }
795
}
796
797
/**
0 commit comments