I am trying to build a user alert mechanism by bringing up the window to the front and then flashing the icon on the screen for the user. I have two questions with regards to this approach:
Thanks a lot for any replies.
How can you find the current window you are at in Java and then de-minimize it and bring to front
Window[] allWindows = Window.getWindows();
returns arrays of all Top-Level Containers
from current JVM e.g. J/Frame
, J/Dialog
(JOptionPane
), J/Window
,
you can to test for (example) if (allWindows[i] instanceof JFrame) {
then WindowState returned WindowEvent
by bringing up the window to the front and then flashing the icon on the screen for the user
use undecodated JDialog
(works toFront
, toBack
) with
create only once time
setDefaultCloseOperations(HIDE_ON_CLOSE)
use Swing Timer
for hide JDialog
Is there a mechanism in Java that would enable me to simply show the icon for a second or two and then hide it, in the middle of the screen? If not, what would be the way to achieve that?
Java Translucent Window
, put there Icon
to the JLabel
(or to the JButton
)use Swing Timer
for flashing by hiding Icon
or swithing bewtween two or more Icons
(three or four is good)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With