如何使用Swing刷新Windows任务栏? [英] How can I flash the Windows taskbar using Swing?

查看:196
本文介绍了如何使用Swing刷新Windows任务栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Swing应用程序,我需要刷新Windows任务栏。我不能使用 frame.requestFocus()因为我不想从任何其他应用程序中窃取焦点。

I'm developing a Swing application and I need to flash the Windows taskbar. I can't use frame.requestFocus() because I don't want to steal focus from any other application.

推荐答案

我不知道它是否适用于较新版本的Windows,但如果当前VM的窗口都不在前台,则用于闪存窗口的.toFront()方法。

I don't know if it applies to newer versions of Windows, but the .toFront() method used to flash the window if none of the current VM's windows were in the foreground.

这意味着在最小化的帧上调用frame.toFront()总是会使它闪烁...

This means that calling frame.toFront() on a minimized frame would always make it flash...

这篇关于如何使用Swing刷新Windows任务栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆