简体   繁体   English

相当于Java Swing中的Android Toast或Mac OSX Growl?

[英]Equivalent to Android's Toast or Mac OSX Growl in Java Swing?

Looking for a means of displaying transient, non-modal dialogs in a Swing application. 寻找一种在Swing应用程序中显示瞬态,非模态对话框的方法。 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: Android Toast屏幕截图: 替代文字
(source: devx.com ) (来源: devx.com

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). 尽管此链接未提供完整的源代码,但此链接提供了有关使用Swing的“半透明形状的Windows”的信息(但幻灯片中说明了实现此目的必须执行的操作)。 He basically uses JNA to avoid problems with repainting translucent windows and makes use of two libraries to easily add fade etc. support. 他基本上使用JNA来避免重绘半透明窗口的问题,并利用两个库轻松地添加淡入淡出等支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM