{"id":26906118,"url":"https://github.com/msh-trojan/java_21_jlist_test_1","last_synced_at":"2025-06-22T11:06:29.279Z","repository":{"id":256474906,"uuid":"847073818","full_name":"MSH-trojan/Java_21_JList_Test_1","owner":"MSH-trojan","description":"This Java program displays a list of color names in a GUI. When a user selects a color, the background of the window changes to match the chosen color. It demonstrates basic JList usage and event handling in Swing.","archived":false,"fork":false,"pushed_at":"2024-09-10T20:55:07.000Z","size":6943,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T11:05:50.432Z","etag":null,"topics":["graphics","gui-components","java","jframe","jlist"],"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/MSH-trojan.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":"2024-08-24T19:14:30.000Z","updated_at":"2024-09-10T21:01:10.000Z","dependencies_parsed_at":"2024-09-11T00:29:32.452Z","dependency_job_id":"138ed392-2707-4cad-9457-643fddb1cc30","html_url":"https://github.com/MSH-trojan/Java_21_JList_Test_1","commit_stats":null,"previous_names":["msh-trojan/java_21_jlist_test_1"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MSH-trojan/Java_21_JList_Test_1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSH-trojan%2FJava_21_JList_Test_1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSH-trojan%2FJava_21_JList_Test_1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSH-trojan%2FJava_21_JList_Test_1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSH-trojan%2FJava_21_JList_Test_1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MSH-trojan","download_url":"https://codeload.github.com/MSH-trojan/Java_21_JList_Test_1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSH-trojan%2FJava_21_JList_Test_1/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261282324,"owners_count":23134939,"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","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":["graphics","gui-components","java","jframe","jlist"],"created_at":"2025-04-01T11:00:02.006Z","updated_at":"2025-06-22T11:06:24.267Z","avatar_url":"https://github.com/MSH-trojan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java_21_JList_Test_1\n\nJLists are used for:\n\n1 - Series of items\n\n2 - user can select one or more items\n\n3 - Single-selection vs. multiple-selection\n\n4 - Using class JList\n\n## overview:\n\nThis Java program demonstrates the use of a JList component in a Swing-based GUI application. \n\nThe program allows users to select a color from a list, and the background of the window will change to the selected color.\n\nThe list is implemented using the JList class and is displayed within a JScrollPane for easy navigation.\n\n## Features:\n\nA list of color names is presented to the user in a scrollable format.\n\nThe user can select a single color at a time.\n\nUpon selection, the background color of the window changes to match the selected color.\n\n## Components Used\n\nJList: To display the list of color names.\n\nJScrollPane: To allow scrolling through the list.\n\nContainer: To manage the layout and components.\n\nListSelectionListener: To handle the event of a user selecting an item from the list.\n\n## How It Works\n\nThe list of color names (colorNames[]) is defined as a String array.\n\nA corresponding array of Color objects (colors[]) holds the actual color values for each name.\n\nThe JList is populated with the color names and set to allow only single selections.\n\nThe ListSelectionListener is implemented using an anonymous inner class, which listens for item \nselections.\n\nWhen an item is selected, the background color of the window changes to the corresponding color \nfrom the colors[] array.\n\nThe list is embedded in a JScrollPane for better usability when there are multiple options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsh-trojan%2Fjava_21_jlist_test_1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsh-trojan%2Fjava_21_jlist_test_1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsh-trojan%2Fjava_21_jlist_test_1/lists"}