Skip to content

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

License

Notifications You must be signed in to change notification settings

Valkryst/JFileLinkLabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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.5.26'
}

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.5.26</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.5.26"

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

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages