📜  java 从字符串中获取颜色 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:22.958000             🧑  作者: Mango

代码示例1
Color color;
try {
    Field field = Class.forName("java.awt.Color").getField("yellow");
    color = (Color)field.get(null);
} catch (Exception e) {
    color = null; // Not defined
}