Skip to content

Instantly share code, notes, and snippets.

@jsfan3
Created June 27, 2020 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsfan3/2fdc5fae2b723cba40e65faab923e552 to your computer and use it in GitHub Desktop.
Save jsfan3/2fdc5fae2b723cba40e65faab923e552 to your computer and use it in GitHub Desktop.
UIID Generation Example
Form hi = new Form("Test UIID", BoxLayout.y());
Button button = new Button("Generate 10 UIID");
hi.add(button);
hi.show();
button.addActionListener(l -> {
String myId = "myUsername"; // do not exceed 12 characters
Preferences.set("CustomDeviceId__$", Long.parseLong(myId, 36));
hi.add(new SpanLabel("10 Random UUID"));
for (int i = 0; i < 10; i++) {
hi.add(new SpanLabel(Util.getUIID()));
}
hi.revalidate();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment