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 create a servlet filter to make secure cookies? - April 18, 2024
- How do I configure secure cookies using web.xml? - April 18, 2024
- How do I create a table with multiple header in iText 8? - March 16, 2024