this article gợi ý bạn có thể sử dụng Color c = Color.decode("FF0096");
tuy nhiên điều này dễ hiểu ném một ngoại lệphong cách css chuỗi hex và Color.decode
Caused by: java.lang.NumberFormatException: For input string: "FF0096"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.valueOf(Integer.java:528)
at java.lang.Integer.decode(Integer.java:958)
at java.awt.Color.decode(Color.java:707)
cách tốt nhất để chuyển đổi một String trong định dạng của "# FF0096" hoặc "FF0096 là gì "vào một màu sắc java awt?
Cảm ơn bạn loại thưa ông. – Boldbayar