Equivalent to Android's Toast or Mac OSX Growl

2019-04-10 14:04发布

问题:

Looking for a means of displaying transient, non-modal dialogs in a Swing application. In other words, I'd like to pop up a semi-transparent box with some text in it that can be immediately dismissed, or will fade away in a set amount of time. Is there a library to do this? I don't want to reinvent the wheel if it already exists.

Growl screenshot: Android Toast screenshot: alt text http://assets.devx.com/articlefigs/40842_4.jpg

回答1:

This link provides information about "translucent shaped Windows" using Swing, though it does not provide the full sourcecode (but slides explaining what has to be done in order to achieve this). He basically uses JNA to avoid problems with repainting translucent windows and makes use of two libraries to easily add fade etc. support.