GithubHelp home page GithubHelp logo

common-swing's Introduction

指令集 通用 SWING 基础库

指令集通用的 Kotlin 基础库,适用于 JVM/Swing 平台。

使用

kotlin_version=1.9.24
java_version=8

dependencies {
    implementation 'com.github.isyscore:common-swing:2.2.4.2'
}

传递依赖

api 'com.github.isyscore:common-jvm:2.2.4.2'

详细信息和用法参考本篇,此处不再赘述 点击进入

基本用法

class MainForm: JFrame("Main") {
    init {
        contentPane = rootVertPanel {
            val tbl = table(arrayRowData = arrayOf(arrayOf("A", true), arrayOf("B", false)), arrayColumnNames = arrayOf("Name", "Checked")) {
                cell<JCheckBox> { cell, value, selected, cellHasFocus, row, col ->
                    // 此处的 this 是 JCheckBox
                    this.isSelected = value as Boolean
                    addActionListener { cell.setEditValue(this.isSelected, row, col) }
                }
            }
            borderPanel {
                button("Check") {
                    addActionListener {
                        val d1 = tbl.model.getValueAt(0, 1)
                        val d2 = tbl.model.getValueAt(1, 1)
                        println("d1 = $d1, d2 = $d2")
                    }
                }
            }
        }
        size { 500 x 300 }
        isVisible = true
    }
}

详细使用案例

  1. 指令集 IIOS HUB 客户端(点击查看)
  2. 完整的组件使用演示(点击查看)

common-swing's People

Contributors

isyscore avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.