问题
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:(source: devx.com)
回答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.
来源:https://stackoverflow.com/questions/2668790/equivalent-to-androids-toast-or-mac-osx-growl-in-java-swing