How to turn off window manager urgency hints for a JFrame?
I have a JFrame
that is basically nothing more than a few JProgressBar
s for a data conversion program that takes several hours to complete. My problem is that the window manager urgency hint gets activated every time I update a progress bar, which is really annoying to have in the corner of my eye all day. I do still want it in my taskbar to be able to check it quickly, so changing it to a JDialog
doesn't help. How can I turn off the urgenc开发者_运维技巧y hints?
If it helps, the program actually runs on Windows 7, java version 1.7.0, although I do a lot of debugging with mock data on a Linux box, so cross-platform solutions are preferred but not critical.
maybe nothing complicated, standards
1) setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
2) there no reason to dispay the JFrame, calling for setVisible(true) see point 5th.
3) System Tray Functionality in Java SE 6
4) you have to add JPopupMenu to the TrayIcon
5) if some events occured then
TrayIcon#displayMessage here you can notify for blablabla as "Aplication started", "for any Aplications Events", or whatever
or by using setVisible(true) display JFrame, but there would be better to search for JFrame#getExtendedState, reason just flashing with JFrame#ICONIFIED in the TaskBar
精彩评论