Getting a Color from a String input

后端 未结 5 1343
不知归路
不知归路 2021-01-23 18:41

I am making an application where at some point i need the user to select a color, but as to not just have 50 radioButtons, I was wondering if it is possible to actually get the

5条回答
  •  误落风尘
    2021-01-23 19:07

    TRy

    Color aColor   = (Color) Color.class.getField("white").get(null);
    

    ALso,

    See if the static method Color.decode() will serve your purpose.

提交回复
热议问题