{"id":18705777,"url":"https://github.com/muqhc/frogui","last_synced_at":"2025-11-09T07:30:25.193Z","repository":{"id":57734273,"uuid":"447939031","full_name":"muqhc/frogui","owner":"muqhc","description":"the kotlin library providing DSL for Swing","archived":false,"fork":false,"pushed_at":"2022-01-17T06:08:24.000Z","size":947,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T06:42:03.788Z","etag":null,"topics":["kotlin","kotlin-library","swing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muqhc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-14T11:09:36.000Z","updated_at":"2022-07-10T10:00:03.000Z","dependencies_parsed_at":"2022-09-26T22:11:01.580Z","dependency_job_id":null,"html_url":"https://github.com/muqhc/frogui","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muqhc%2Ffrogui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muqhc%2Ffrogui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muqhc%2Ffrogui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muqhc%2Ffrogui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muqhc","download_url":"https://codeload.github.com/muqhc/frogui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239571545,"owners_count":19661164,"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":["kotlin","kotlin-library","swing"],"created_at":"2024-11-07T12:11:54.636Z","updated_at":"2025-11-09T07:30:25.113Z","avatar_url":"https://github.com/muqhc.png","language":"Kotlin","readme":"# frogui\n#### the kotlin library providing DSL for Swing\n## add dependency\n### Gradle Kotlin DSL\n#### build.gradle.kts\n```kotlin\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"io.github.muqhc:frogui:0.2.0\")\n}\n```\n\n## examples\n### to use....\n```kotlin\nimport io.github.muqhc.frogui.*\n```\n\n---\n\n### build JPanel  (by using frogui dsl)\n```kotlin\nval myPane = borderLayout {\n\n    //add component to 'north'\n    north = JButton(\"I'm north!\")\n    \n    //add component to 'south'\n    south = JButton(\"I'm south!\")\n\n    //add component to 'center'\n    center = gridLayout { // add inner panel\n        layout.columns = 2\n\n        //use 'unary plus' to add component\n        +JButton(\"I'm the First!\")\n\n        +flowLayout { // add inner panel\n            +JButton(\"[ 1 ]\")\n            +JButton(\"[ 2 ]\")\n            +JButton(\"[ 3 ]\")\n        }\n    }\n}\n```\n![example_image.png](README_RESOURCES/example_image.png)\n\n---\n\n### make your own custom JPanel\n```kotlin\nclass CounterPanel() : JPanel() {\n    var value = 0\n\n    val device = JLabel(\"$value\").apply { horizontalAlignment = JLabel.CENTER }\n\n    init {\n        // ==== Here !!! ====\n        gridLayout {\n            layout.rows = 2\n            +device\n            +gridLayout {\n                layout.columns = 2\n                +JButton(\"-\").apply { addActionListener { update(value - 1) } }\n                +JButton(\"+\").apply { addActionListener { update(value + 1) } }\n            }\n        }\n        // ==========\n    }\n\n    fun update(value: Int) {\n        this.value = value\n        device.text = value.toString()\n    }\n}\n```\n![example_video.gif](README_RESOURCES/example_video.gif)\n\n---\n\n##### ( you can also extend it )\n```kotlin\nval customPane = CounterPanel() gridLayout {\n    layout.rows = 3\n    +JButton(\"Reset!\").apply { addActionListener { panel.update(0) } }\n}\n```\n\n![example_video2.gif](README_RESOURCES/example_video2.gif)\n\n---\n\n### [whole example code](frogui-debug/src/main/kotlin/io/github/muqhc/frogui)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuqhc%2Ffrogui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuqhc%2Ffrogui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuqhc%2Ffrogui/lists"}