Skip to content

Latest commit

 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JFileLinkLabel is a Java Swing component designed to display a usable link to a File, Path, or URI.

Table of Contents

Installation

JFileLinkLabel is hosted on the JitPack package repository which supports Gradle, Maven, and sbt.

Gradle Gradle

Add JitPack to your build.gradle at the end of repositories.

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add JFileLinkLabel as a dependency.

dependencies {
	implementation 'com.github.Valkryst:JFileLinkLabel:2025.11.22'
}

Maven Maven

Add JitPack as a repository.

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add JFileLinkLabel as a dependency.

<dependency>
    <groupId>com.github.Valkryst</groupId>
    <artifactId>JFileLinkLabel</artifactId>
    <version>2025.11.22</version>
</dependency>

Scala SBT Scala SBT

Add JitPack as a resolver.

resolvers += "jitpack" at "https://jitpack.io"

Add JFileLinkLabel as a dependency.

libraryDependencies += "com.github.Valkryst" % "JFileLinkLabel" % "2025.11.22"

Example

This creates a new JFileLinkLabel and displays it in a JFrame.

public class Driver {
  public static void main(final String[] args) {
    SwingUtilities.invokeLater(() -> {
      final JFileLinkLabel link = new JFileLinkLabel(
              "Link to Home Directory",
              Paths.get(System.getProperty("user.home"))
      );
      link.setForeground(Color.BLUE);

      final JFrame frame = new JFrame("JFileLinkLabel Example");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setPreferredSize(new Dimension(400, 100));

      final Container contentPane = frame.getContentPane();
      contentPane.setLayout(new BorderLayout());
      contentPane.add(link, BorderLayout.CENTER);

      frame.setVisible(true);
      frame.pack();
      frame.setLocationRelativeTo(null);
    });
  }
}

About

A Java Swing component designed to display a clickable link to a File, Path, or URI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages