DevelopmentAll versions
On this page

KetraTerm Swing

ketraterm-swing is the dependency entry point for embedding a terminal in a Swing application. It exports the reusable SwingTerminal component and the headless session pipeline through dependency metadata; it contains no runtime code of its own. The libraries require Java 25.

Installation

Import the BOM and select the Swing entry point:

dependencies {
    implementation(platform("io.github.ketraterm:ketraterm-bom:{version}"))
    implementation("io.github.ketraterm:ketraterm-swing")
}

See the root setup guide for repositories and version selection.

For Maven, import the BOM in dependencyManagement, then declare this dependency with POM type:

<dependency>
  <groupId>io.github.ketraterm</groupId>
  <artifactId>ketraterm-swing</artifactId>
  <type>pom</type>
</dependency>

Embedding a terminal

The entry point directly exports Swing UI, which exports session APIs and the same terminal pipeline described by the headless entry point. There is no need to add both entry points.

Supply a TerminalSession backed by your own TerminalConnector, then construct and bind SwingTerminal on the Swing event dispatch thread. The host owns the session: disposing the view releases its binding without closing the session. See the view lifecycle and settings guide and the session usage guide.

Add integrations according to the host's needs:

Dependency Purpose
ketraterm-pty Local processes through Pty4J.
ketraterm-shell-integration Optional OSC shell metadata producer, configured explicitly by the host.
ketraterm-ui-swing-host Search chrome, host actions, clipboard consent, and completion adapters.

For custom assembly, depend directly on individual modules. For a terminal without Swing, use the headless entry point.