Back to Trending
RepositoryJavaKHCambodia
DJ-Raven

DJ-Raven/swing-toast-notifications

Swing toast notifications use for java desktop application

108stars
19forks
5issues
3views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: toast

#1 Repository of the month

2
TINIX TRENDING·Topic: flatlaf

#2 Repository of the month

2
TINIX TRENDING·Topic: java-swing

#2 Repository of the month

Swing-Toast-Notifications

This swing toast notifications use for java desktop application gui swing with flatlaf

sample dark sample light

Install

This library not available in maven, try use jar file, by copy to the root project /library/swing-toast-notifications-1.0.3.jar

<dependency>
    <groupId>raven.toast</groupId>
    <artifactId>swing-toast-notifications</artifactId>
    <version>1.0.3</version>
    <scope>system</scope>
    <systemPath>${basedir}/library/swing-toast-notifications-1.0.3.jar</systemPath>
</dependency>
  • Other library are use with this library
<dependency>
  <groupId>com.formdev</groupId>
  <artifactId>flatlaf</artifactId>
  <version>3.4.1</version>
</dependency>

<dependency>
  <groupId>com.formdev</groupId>
  <artifactId>flatlaf-extras</artifactId>
  <version>3.4.1</version>
</dependency>

Getting started

  • Import flatlaf library and flatlaf extras to your project
  • And Import swing toast notifications (check jar file in library folder)
//  Setup notifications with jfram

Notifications.getInstance().setJFrame(jfram);

//  Show notifications

Notifications.getInstance().show(Notifications.Type.SUCCESS, Notifications.Location.TOP_CENTER, "Hello");

//  Show notification with custom component

Notifications.getInstance().show(new JButton("My Custom Button"));

//  Clear top right notifications

Notifications.getInstance().clear(Notifications.Location.TOP_RIGHT);

//  Clear all notifications

Notifications.getInstance().clearAll();
//  Install flatlaf look and feel to your application

FlatIntelliJLaf.setup();
//  Notifications Type

public enum Type {
  SUCCESS, INFO, WARNING, ERROR
}

//  Notification Location

public enum Location {
  TOP_LEFT, TOP_CENTER, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT
}

Custom with flatlaf properties

Create flatlaf file properties FlatLaf.properties

Toast.background=lighten(@background,5%)
Toast.outlineWidth = 1
Toast.success.foreground = rgb(53,198,203)
Toast.frameInsets = 15,15,15,15
KeyDescriptionValue TypeDefault values
Toast.outlineWidthint0
Toast.iconTextGapint5
Toast.closeButtonGapint5
Toast.arcint20
Toast.horizontalGapint10
Toast.limit-1 as unlimitedint-1
Toast.durationlong2500
Toast.animationint200
Toast.animationResolutionint5
Toast.animationMoveint10
Toast.minimumWidthint50
Toast.maximumWidth-1 as not setint-1
Toast.shadowColorColor
Toast.shadowOpacity0 to 1ffloat0.1f
Toast.shadowInsetsInsets0,0,6,6
Toast.useEffectbooleantrue
Toast.effectWidth0.5f as 50%float0.5f
Toast.effectOpacity0 to 1ffloat0.2f
Toast.effectAlignmentleft, rightStringleft
Toast.effectColorColor
Toast.success.effectColorColor
Toast.info.effectColorColor
Toast.warning.effectColorColor
Toast.error.effectColorColor
Toast.outlineColorColor
Toast.foregroundColor
Toast.backgroundColor
Toast.success.outlineColorColor
Toast.success.foregroundColor
Toast.success.backgroundColor
Toast.info.outlineColorColor
Toast.info.foregroundColor
Toast.info.backgroundColor
Toast.warning.outlineColorColor
Toast.warning.foregroundColor
Toast.warning.backgroundColor
Toast.error.outlineColorColor
Toast.error.foregroundColor
Toast.error.backgroundColor
Toast.frameInsetsInsets10,10,10,10
Toast.marginInsets8,8,8,8
Toast.showCloseButtonbooleantrue
Toast.closeIconColorColor

Using UI Manager

//  Using flatlaf extras to crate flat svg icon
//  Use this code in main method

UIManager.put(ToastClientProperties.TOAST_INFO_ICON, new FlatSVGIcon("raven/toast/error.svg"));
KeyDescriptionValue Type
Toast.success.iconIcon
Toast.info.iconIcon
Toast.warning.iconIcon
Toast.error.iconIcon
Toast.closeIconIcon

Visit flatlaf for more

Update Note

  • version 1.0.1
    • add properties Toast.maximumWidth
    • add properties Toast.limit
    • add method void clearHold() and void clearHold(Location location)

Fixed Note

  • version 1.0.1
    • fixed notification style properties background

Similar Projects

Discover other similar projects and AI models.

RepositoryJava
JFormDesigner/FlatLaf

FlatLaf - Swing Look and Feel (with Darcula/IntelliJ themes support)

4.3k
Nov 30, 2026
RepositoryJava
DJ-Raven/swing-modal-dialog

Java Swing UI library custom with FlatLaf

158
Sep 24, 2026
RepositoryJava
DJ-Raven/flatlaf-dashboard

Java Swing Dashboard build with flatlaf look and feel

100
Feb 13, 2025
RepositoryJava
DJ-Raven/swing-datetime-picker

Java swing flatlaf datetime picker

85
Aug 24, 2026
RepositoryJava
DJ-Raven/java-messenger

Java swing messenger real-time chat with nodejs as server

51
Oct 14, 2026
RepositoryJavaScript
sweetalert2/sweetalert2

✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. 🇺🇦🇪🇺

18.1k
Nov 24, 2026
RepositoryTypeScript
hiaaryan/sileo

An opinionated, physics-based toast component for React.

1.9k
Oct 14, 2026
RepositoryPowerShell
Windos/BurntToast

Module for creating and displaying Toast Notifications on Microsoft Windows 10.

1.7k
Sep 25, 2026
RepositoryKotlin
ahatem/QTranslate

A fast, extensible desktop translation suite. Translate, OCR, TTS, spell check — with a plugin system.

326
Nov 30, 2026