Skip to content

imthosea/libkswing

Repository files navigation

libkswing

KSwing is a Kotlin library for the Java Swing toolkit, inspired by Kotlin Compose and SwiftUI.

val pizzasOrdered = KNonnullState(1)
KGroupPanel {
	KFlowPanel(addConstraints = BorderLayout.CENTER) {
		KHGlue()
		KLabel {
			pizzasOrdered.use {
				text = "$it pizzas will be ordered"
			}
		}
	}
	KFlowPanel(addConstraints = BorderLayout.PAGE_END) {
		KButton("Add another").kActionListener { pizzasOrdered.value++ }
	}
}

See the GitHub wiki for a tutorial.

Examples

There are currently three examples:

A simple recreation of a JDialog using either GridBagLayout or GroupLayout,
Eggs aren't supposed to be green

A simple reminders app that lets you add/remove, check off and set the time of your reminders,
It's like Apple reminders, but not

And a silly vessel creator.
WHAT VESSEL WILL YOU MAKE?

These are located in the example directory and use FlatLaf as their look and feel. They're also available as a runnable jar on GitHub releases!

Licensing

The library and the examples are under a very liberal BSD-2 clause license. See the LICENSE file for more.

Installing

Add the maven repo:

Gradle (Kotlin)
maven {
	name = "teamcelestial"
	url = "https://maven.teamcelestial.org/public"
}
Gradle (Groovy)
maven {
    name "teamcelestial"
    url "https://maven.teamcelestial.org/public"
}
Maven
<repository>
  <id>teamcelestial</id>
  <url>https://maven.teamcelestial.org/public</url>
</repository>

Then add the dependency:

Gradle (Kotlin)
implementation("me.thosea:libkswing:<version>")
Gradle (Groovy)
implementation "me.thosea:libkswing:<version>"
Maven
<dependency>
  <groupId>me.thosea</groupId>
  <artifactId>libkswing</artifactId>
  <version>version</version>
</dependency>

Find the latest version here: https://maven.teamcelestial.org/#/public/me/thosea/libkswing/

About

Kotlin library for Java Swing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages