Java Swing - User Alerts

I am trying to create a user alert mechanism by putting a window in the foreground and then blinking an icon on the screen for the user. I have two questions regarding this approach:

  • How can you find the current window you are in in Java and then remove it and bring it to the fore?
  • Is there a mechanism in Java that allows 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 this?

Thanks so much for any answers.

+5
source share
2 answers

As you can find the current window you are in, in Java, then delete it and bring it to the front.

Window[] allWindows = Window.getWindows(); 
  • Top-Level Containers JVM, . J/Frame, J/Dialog (JOptionPane), J/Window,

  • () if (allWindows[i] instanceof JFrame) {

  • WindowState WindowEvent

,

JDialog ( toFront, toBack)

  • setDefaultCloseOperations(HIDE_ON_CLOSE)

  • Swing Timer JDialog

Java , , ? , ?

  • Java Translucent Window, Icon JLabel ( JButton)

Swing Timer , Icon swithing bewtween two or more Icons ( )

+12

All Articles