我需要在 java JAVA CODE中为这个解决方案提供一个 delphi 解决方案
type
TColors = (red, green, blue, white, purple, orange, yellow, black);
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var Form1: TForm1;
implementation
{$R *.fmx}
function RandomColor: TColors;
begin
result := blue; // make this random value from enum ????
end;
procedure TForm1.Button1Click(Sender: TObject);
var
s: string;
begin
s := GetEnumName(TypeInfo(TColors), integer(RandomColor));
Memo1.Lines.Add(s); /// print random color to memo
end;