package org.kodejava.swing;
import javax.swing.*;
import java.awt.*;
public class WindowTaskbarFlash extends JFrame {
private WindowTaskbarFlash() throws HeadlessException {
initUI();
}
public static void main(String[] args) {
SwingUtilities.invokeLater(
() -> new WindowTaskbarFlash().setVisible(true));
}
private void initUI() {
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
pack();
setSize(200, 200);
setState(Frame.ICONIFIED);
// Demonstrate flashes the application window task bar
// by calling the toFront method every 5 seconds.
Timer timer = new Timer(5000, e -> toFront());
timer.start();
}
}
Latest posts by Wayan (see all)
- How do I get number of each day for a certain month in Java? - September 8, 2024
- How do I get operating system process information using ProcessHandle? - July 22, 2024
- How do I sum a BigDecimal property of a list of objects using Java Stream API? - July 22, 2024