A library for creating simple GUIs in introduction-level programming courses. The default backend uses Swing to display the GUI in a window, but the library does not expose any Swing types or concepts directly; instead, all functionality is exposed using a simple, single-threaded, and mostly primitive-type-based API. In addition, there is an experimental backend that exposes the GUI as a web page using an HTML5 canvas.
The base API uses a single object of type Gui and focuses on drawing operations and global user inputs. An extended interface allows adding "Components", which are objects that draw themselves on the GUI and can react to local user inputs using simple callbacks.
More Info in the API Documentation.
The library is hosted in a public Maven repository on gitlab.fhnw.ch, where you can check for the latest version and download the JAR file.
For Maven projects, add the following to your pom.xml file:
<dependencies>
<dependency>
<groupId>ch.trick17.gui</groupId>
<artifactId>gui</artifactId>
<version>2.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://gitlab.fhnw.ch/api/v4/projects/17730/packages/maven</url>
</repository>
</repositories>
For Gradle projects:
repositories {
mavenCentral()
maven {
url "https://gitlab.fhnw.ch/api/v4/projects/17730/packages/maven"
}
}
dependencies {
implementation 'ch.trick17.gui:gui:2.1.0-SNAPSHOT'
}