{"id":22503168,"url":"https://github.com/afa-farkhod/digits-sum","last_synced_at":"2026-04-28T08:39:44.750Z","repository":{"id":153819091,"uuid":"616862971","full_name":"afa-farkhod/Digits-Sum","owner":"afa-farkhod","description":"Digits-Sum built on java, UI on window builder, building tool gradle","archived":false,"fork":false,"pushed_at":"2023-07-02T00:39:30.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-30T05:41:07.030Z","etag":null,"topics":["desktop-application","eclipse","gradle","java","swing","windowbuilder"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afa-farkhod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-21T08:36:22.000Z","updated_at":"2023-07-01T07:51:04.000Z","dependencies_parsed_at":"2023-10-03T17:27:26.945Z","dependency_job_id":null,"html_url":"https://github.com/afa-farkhod/Digits-Sum","commit_stats":null,"previous_names":["afa-farkhod/digits-sum"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/afa-farkhod/Digits-Sum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afa-farkhod%2FDigits-Sum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afa-farkhod%2FDigits-Sum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afa-farkhod%2FDigits-Sum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afa-farkhod%2FDigits-Sum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afa-farkhod","download_url":"https://codeload.github.com/afa-farkhod/Digits-Sum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afa-farkhod%2FDigits-Sum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32373515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"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":["desktop-application","eclipse","gradle","java","swing","windowbuilder"],"created_at":"2024-12-06T23:29:59.157Z","updated_at":"2026-04-28T08:39:44.735Z","avatar_url":"https://github.com/afa-farkhod.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digits-Sum\nDigits-Sum built on java, UI on window builder, building tool gradle.\n\n- Simple project to check gradle building tool installation. Program sums all digits of given number:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/24220136/226554269-d267bc23-c826-42fc-96be-bc93000a4036.png\" alt=\"Image\"\u003e\n\u003c/p\u003e\n\n## IMPORTANT \n\n- Popular error message is while trying to run jar file:\n\n```\n$ java -jar untitled-1.0-SNAPSHOT.jar\nno main manifest attribute, in untitled-1.0-SNAPSHOT.jar\n```\n\n- To handle this, we have to add manifest file with the 'Main-Class' attribute to the JAR file in `build.gradle` file:\n\n```\ntasks.jar {\n    manifest {\n        attributes[\"Main-Class\"] = \"org.example.Main\"\n    }\n}\n\n```\n\n--------------------\n\n## [Implementation](https://github.com/af4092/Digits-Sum/blob/main/GradleAF/lib/src/main/java/gradleaf/Main.java)\n\n- Java Swing-based user interface (UI) class named UI. It creates a simple GUI window that allows the user to input a number and calculate the sum of its digits\n\n- The code is in a package named `gradleaf`.\n\n- The UI class extends the `JFrame` class to create a window-based UI.\n\n- The UI consists of a panel named `contentPane`, which serves as the main container for UI components.\n\n- The UI contains several UI components:\n\n    - A `JTextField` named `tfInput` for the user to enter a number.\n    - A `JLabel` named `lbOutput` to display the result of the sum.\n    - A `JLabel` named `lblNewLabel` to display a title for the UI.\n    - A `JButton` named `btnSum` to initiate the calculation.\n    \n- In the constructor of the UI class:\n\n    - The UI window's title, size, and close operation are set.\n    - The content pane's layout is set to null.\n    - The UI components are created, positioned, and added to the content pane.\n    - An `action listener` is added to the btnSum button, which listens for button clicks. When the button is clicked, the action listener's actionPerformed method is invoked.\n\n- Inside the actionPerformed method:\n\n    - The text entered in the tfInput field is retrieved using `tfInput.getText()`.\n    - The retrieved text is parsed into a Long value using `Long.parseLong()` and stored in `inputDouble`.\n    - An instance of the `sumDigits` class (not provided) is created.\n    - The sumDigits object's sumDigits method is called, passing `inputDouble` as an argument.\n    - The returned result is cast to an int and stored in the result variable.\n    - The result is converted to a String using `Integer.toString()` and stored in resultFinal.\n    - The `resultFinal` string is set as the text of the `lbOutput` label.\n    - The UI class does not define the sumDigits class, so the calculation logic for summing the digits of a number is missing. To make the code functional, you need to define the `sumDigits` class separately and provide its implementation.\n\n- When the `UI` is launched and interacted with, it provides a simple input field for entering a number, a button to trigger the digit sum calculation, and a label to display the result.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafa-farkhod%2Fdigits-sum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafa-farkhod%2Fdigits-sum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafa-farkhod%2Fdigits-sum/lists"}