GithubHelp home page GithubHelp logo

k33ptoo / krandomuser Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 5.0 63 KB

A JavaFX/Java Swing Consumable Library for getting random users data with abundant details from api provided by https://random-data-api.com/

Home Page: https://random-data-api.com/

License: Apache License 2.0

Java 100.00%
api java javafx random

krandomuser's Introduction

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

<dependency>
  <groupId>com.k33ptoo</groupId>
  <artifactId>KRandomUser</artifactId>
  <version>1.0.1</version>
</dependency>

Code

 /**
  * How to use on Java Swing
  * InvokeLater to prevent UI Blocking
  */
   SwingUtilities.invokeLater(()->{
    KRandomUser.fetchRandomUserList(50, (List<KRandomUserModel> 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<ObservableList<T>> t = new Task() {
        @Override
        protected Object call() throws Exception {
            ObservableList<T> 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 for developing such an awesome free api.

For more information about the api visit https://random-data-api.com/documentation

krandomuser's People

Contributors

k33ptoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

krandomuser's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.