https://github.com/k33ptoo/krandomuser
A JavaFX/Java Swing Consumable Library for getting random users data with abundant details from api provided by https://random-data-api.com/
https://github.com/k33ptoo/krandomuser
api java javafx random
Last synced: 12 months ago
JSON representation
A JavaFX/Java Swing Consumable Library for getting random users data with abundant details from api provided by https://random-data-api.com/
- Host: GitHub
- URL: https://github.com/k33ptoo/krandomuser
- Owner: k33ptoo
- License: apache-2.0
- Created: 2021-07-12T16:03:20.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-06T11:10:49.000Z (almost 5 years ago)
- Last Synced: 2025-04-04T03:04:16.218Z (over 1 year ago)
- Topics: api, java, javafx, random
- Language: Java
- Homepage: https://random-data-api.com/
- Size: 61.5 KB
- Stars: 9
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KRandomUser
A JavaFX /Java Swing Consumable Library for getting 100 random users data with abundant details from api provided by https://random-data-api.com/
**Usage**
Maven
``` xml
com.k33ptoo
KRandomUser
1.0.1
```
Code
``` java
/**
* How to use on Java Swing
* InvokeLater to prevent UI Blocking
*/
SwingUtilities.invokeLater(()->{
KRandomUser.fetchRandomUserList(50, (List data) -> {
//do something with the list of data
});
});
/**
* How to use on JavaFX without blocking the UI
* You have to run on a task
*/
ExecutorService es = Executors.newCachedThreadPool();
Task> t = new Task() {
@Override
protected Object call() throws Exception {
ObservableList oLst = FXCollections.observableArrayList();
KRandomUser.fetchRandomUserList(50, list -> {
for (KRandomUserModel f : list) {
oLst.add(/*whatever infor you want*/);
}
});
return oLst;
}
};
es.submit(t);
t.setOnSucceeded((evt) -> {
tableView.setItems(t.getValue());
});
```
Other user details are as follows

Credits to [Marko Manojlovic](https://github.com/thecookieorg) for developing such an awesome free api.
For more information about the api visit https://random-data-api.com/documentation