Summary
javax.swing.Timerを使って文字列が点滅するJLabelを作成します。
Screenshot

Advertisement
Source Code Examples
JLabel label = new JLabel();
Timer timer = new Timer(300, e -> {
label.setText("".equals(label.getText()) ? "!!!Warning!!!" : "");
});
timer.start();
View in GitHub: Java, KotlinDescription
javax.swing.Timerを使ってJLabelにテキスト文字列と空文字列を交互に設定することで点滅を表現しているSwingなどのGUIコンポーネントを更新する場合、汎用的で多機能なjava.util.TimerはでなくアクションがEDT(イベント・ディスパッチ・スレッド)で実行されるjavax.swing.Timerを使用する必要がある