{"id":18614947,"url":"https://github.com/andrewjbateman/javafx-observables-tasks","last_synced_at":"2026-05-16T08:39:33.736Z","repository":{"id":96860381,"uuid":"382391847","full_name":"AndrewJBateman/javafx-observables-tasks","owner":"AndrewJBateman","description":":clipboard: JavaFX using observables and threads","archived":false,"fork":false,"pushed_at":"2021-07-28T08:39:47.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-17T01:34:29.838Z","etag":null,"topics":["fxml","fxml-viewer","java","javafx","observablelist","tutorial-code"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-02T15:42:51.000Z","updated_at":"2023-05-30T04:22:04.000Z","dependencies_parsed_at":"2023-05-12T00:45:56.368Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/javafx-observables-tasks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/javafx-observables-tasks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavafx-observables-tasks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavafx-observables-tasks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavafx-observables-tasks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavafx-observables-tasks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/javafx-observables-tasks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavafx-observables-tasks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267236822,"owners_count":24057657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fxml","fxml-viewer","java","javafx","observablelist","tutorial-code"],"created_at":"2024-11-07T03:27:37.955Z","updated_at":"2026-05-16T08:39:33.701Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: JavaFX Observables Tasks\n \n* Java code to display list of employees when button pressed in FXML controller gridpane \n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/javafx-observables-tasks?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/javafx-observables-tasks?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/javafx-observables-tasks?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/javafx-observables-tasks?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: JavaFX Observables Tasks](#zap-javafx-observables-tasks)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Code from Java Programming Masterclass Section 15-285 JavaFx background tasks in Java - see [:clap: Inspiration](#clap-inspiration) below\n* Progress bar shown below list with text detail of data added using simple for loop\n* Employee Service now separated\n* Progress bar and Progress label binding to \n\n## :camera: Screenshots\n\nN/A\n\n## :signal_strength: Technologies\n\n* [Java v11](https://www.java.com/en/)\n* [JavaFX v11](https://www.jetbrains.com/help/idea/javafx.html#create-project) - now a Java Plugin\n* [class Collections](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collections.html) static methods that operate on or return collections.\n* [interface ObservableList](https://docs.oracle.com/javase/10/docs/api/javafx/collections/ObservableList.html) - a list that allows you to track changes\n* [JavaFX FXML](http://tutorials.jenkov.com/javafx/fxml.html) an XML format that enables you to compose JavaFX GUIs like web GUIs in HTML\n\n## :floppy_disk: Setup\n\n* Open folder in an IDE such as IntelliJ. Run  from `Main.java`\n\n## :computer: Code Examples\n\n* `Main.java` code to create a list observable then bind values to a FXML ListView\n\n```java\npublic class Controller {\n\n  private Task\u003cObservableList\u003cString\u003e\u003e task;\n\n  @FXML\n  private ListView listView;\n\n  @FXML\n  private ProgressBar progressBar;\n\n  @FXML\n  private Label progressLabel;\n\n  public void initialize() {\n    task = new Task\u003cObservableList\u003cString\u003e\u003e() {\n      @Override\n      protected ObservableList\u003cString\u003e call() throws Exception {\n\n        String[] names = {\"Tim Buchalka\",\n                \"Bill Rogers\",\n                \"Jack Jill\",\n                \"Joan Andrews\",\n                \"Mary Johnson\",\n                \"Bob McDonald\"};\n\n        ObservableList\u003cString\u003e employees = FXCollections.observableArrayList();\n\n        for(int i=0; i\u003c6; i++) {\n          employees.add(names[i]);\n          updateMessage(names[i] + \" added to the list\");\n          updateProgress(i + 1, 6);\n          Thread.sleep(200);\n          updateMessage(\"list complete\");\n        }\n        return employees;\n\n      }\n    };\n\n    progressBar.progressProperty().bind(task.progressProperty());\n    progressLabel.textProperty().bind(task.messageProperty());\n    listView.itemsProperty().bind(task.valueProperty());\n  }\n\n  @FXML\n  public void buttonPressed() {\n    new Thread(task).start();\n  }\n}\n```\n\n## :cool: Features\n\n* Progress label shows each name as it is added to the list then a 'list complete' message is displayed\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working\n* To-Do: Nothing\n\n## :clap: Inspiration\n\n* [Udemy: Java Programming Masterclass for Software Developers](https://www.udemy.com/course/java-the-complete-java-developer-course/learn/lecture/3561816#overview)\n* [SimpleTech TV: Fix JavaFX runtime components are missing and are required to run this application in IntelliJ IDEA](https://www.youtube.com/watch?v=pqbyQRACEgk)\n\n## :file_folder: License\n\n* N/A\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://www.andrewbateman.org), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavafx-observables-tasks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fjavafx-observables-tasks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavafx-observables-tasks/lists"}