{"id":15719833,"url":"https://github.com/dorkbox/notify","last_synced_at":"2025-04-05T18:07:50.307Z","repository":{"id":37789063,"uuid":"51482703","full_name":"dorkbox/Notify","owner":"dorkbox","description":"Linux, MacOS, or Windows (notification/growl/toast) popups for the desktop and applications for Java 8+","archived":false,"fork":false,"pushed_at":"2025-03-04T06:17:47.000Z","size":690,"stargazers_count":90,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T17:08:33.299Z","etag":null,"topics":["java","notifications"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dorkbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-11T00:02:32.000Z","updated_at":"2025-03-03T22:08:17.000Z","dependencies_parsed_at":"2023-11-22T22:23:58.096Z","dependency_job_id":"0b20d5c8-2a9b-46c2-a79d-7f365cddc2d5","html_url":"https://github.com/dorkbox/Notify","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dorkbox%2FNotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dorkbox%2FNotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dorkbox%2FNotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dorkbox%2FNotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dorkbox","download_url":"https://codeload.github.com/dorkbox/Notify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378142,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","notifications"],"created_at":"2024-10-03T21:56:56.127Z","updated_at":"2025-04-05T18:07:50.286Z","avatar_url":"https://github.com/dorkbox.png","language":"Kotlin","readme":"# Notify\n\nCross platform notification popups, similar to \"Growl\" on OSX, \"Toasts\" on Windows, and \"Notifications\" on Ubuntu.\n\nThis small library can display notifications on any screen, in any corner.\n\n## Table of Contents\n\n* [Installation](https://github.com/dorkbox/Notify#installation)\n    * [Gradle](https://github.com/dorkbox/Notify#gradle)\n    * [Maven](https://github.com/dorkbox/Notify#maven)\n    * [Scala SBT](https://github.com/dorkbox/Notify#scala-sbt)\n* [Basic Usage](https://github.com/dorkbox/Notify#basic-usage)\n  * [Display Desktop Notification](https://github.com/dorkbox/Notify#display-desktop-notification)\n  * [Display JFrame Notification](https://github.com/dorkbox/Notify#display-jframe-notification)\n* [Features](https://github.com/dorkbox/Notify#features)\n* [Release Notes](https://github.com/dorkbox/Notify#release-notes)\n\n## Installation \n\nNotify is hosted on the [Maven Central Repository](https://mvnrepository.com/artifact/com.dorkbox/Notify) and\ncan be included in your project by adding it as a dependency in your build file.\n\n### ![Gradle](https://i.imgur.com/qtc6bXq.png?1) Gradle\n```\ndependencies {\n\timplementation 'com.dorkbox:Notify:4.5'\n}\n```\n\n### ![Maven](https://i.imgur.com/2TZzobp.png?1) Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.dorkbox\u003c/groupId\u003e\n    \u003cartifactId\u003eNotify\u003c/artifactId\u003e\n    \u003cversion\u003e4.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### ![Scala SBT](https://i.imgur.com/Nqv3mVd.png?1) Scala SBT\n\n```\nlibraryDependencies += \"com.dorkbox\" % \"Notify\" % \"4.5\"\n```\n\n## Basic Usage\n\n### Display Desktop Notification\n\n```java\npublic class Example {\n  public static void main(final String[] args) {\n    Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -\u003e {\n      Notify.Companion.create()\n              .title(\"Title Text\")\n              .text(\"Hello World!\")\n              .theme(Theme.Companion.getDefaultDark())\n              .position(Position.BOTTOM_RIGHT)\n              .hideAfter(1500)\n              .showWarning();\n    }, 0, 2, TimeUnit.SECONDS);\n  }\n}\n```\n\n### Display JFrame Notification\n\n```java\npublic class Example {\n  public static void main(final String[] args) {\n    SwingUtilities.invokeLater(() -\u003e {\n      final var frame = new JFrame(\"Example\");;\n      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n      frame.setPreferredSize(new Dimension(512, 512));\n      frame.setLocationRelativeTo(null);\n      frame.pack();\n      frame.setVisible(true);\n\n      final var notify = Notify.Companion.create()\n                                 .title(\"Example Title\")\n                                 .text(\"Example Message\")\n                                 .theme(Theme.Companion.getDefaultDark())\n                                 .position(Position.BOTTOM_RIGHT)\n                                 .hideAfter(1500)\n                                 .attach(frame);\n      \n      Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(notify::showWarning, 0, 2, TimeUnit.SECONDS);\n    });\n  }\n}\n```\n\n## Features\n\n1. Can specify which screen to use for notification.\n2. Can specify which corner (center is also possible) to use for notification \n3. If no location is specified, it will show on whatever screen the mouse is on (if a desktop notification)\n4. Duration timeouts, with progress indicator on notification\n5. Light or Dark themes\n6. Can close via close button or clicking on notification body\n7. Can show/hide the close button\n8. Can register a callback for when a user clicks on the notification body\n9. Animates to a collated position if multiple notifications are in the same position\n10. Bypasses the swing EDT, and now renders at a beautiful 30 frames-per-second.\n11. Can have notifications in an application or on the desktop.\n\n\n- This is for cross-platform use, specifically - linux 32/64, mac 32/64, and windows 32/64. Java 6+\n- You will need the images in the 'resources' directory, in addition to the normal libs.\n- Note: If you want to **COMPLETELY** remove repainting by the swing EDT (for the entire JVM), run `NullRepaintManager.install();`\n\n```\nCustomization parameters:\n\n-ActiveRenderLoop.TARGET_FPS  (type int, default value '30')\n - How many frames per second we want the Swing ActiveRender thread to run at?\n - NOTE: The ActiveRenderLoop replaces the Swing EDT (only for specified JFrames) in order to enable smoother animations. \n  It is also important to REMEMBER -- if you add a component to an actively managed JFrame, YOU MUST make sure to call\n  JComponent.setIgnoreRepaint(boolean) otherwise this component will \"fight\" on the EDT for updates. You can completely\n  disable the EDT by calling NullRepaintManager.install()\n\n\nNotify.IMAGE_PATH    (type String, default value 'resources')\n - Location of the dialog image resources. By default they must be in the 'resources' directory relative to the application\n \n \nNotify.TITLE_TEXT_FONT    (type String, default value 'Source Code Pro BOLD 16')\n - This is the title font used by a notification.\n\n \nNotify.MAIN_TEXT_FONT    (type String, default value 'Source Code Pro BOLD 12')\n - This is the main text font used by a notification.\n    \n \nNotify.MOVE_DURATION    (type float, default value '1.0F')\n - How long we want it to take for the popups to relocate when one is closed\n```\n\n![light theme](https://raw.githubusercontent.com/dorkbox/Notify/master/notify-light.png)\n\n![dark theme](https://raw.githubusercontent.com/dorkbox/Notify/master/notify-dark.png)\n\n## Release Notes\nIt is important to note that notifications for an application use the [glassPane](https://docs.oracle.com/javase/tutorial/uiswing/components/rootpane.html#glasspane) and sets it's ````layoutManager```` to ````null````. This can cause problems with some applications, and you'll need to work around this limitation.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdorkbox%2Fnotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdorkbox%2Fnotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdorkbox%2Fnotify/lists"}