import javax.swing.*; import java.awt.*; public class BlinkLoading extends StandardJFrame implements Runnable { JLabel myLabel; static boolean running = true; public BlinkLoading() { setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setSize(200, 100); getContentPane().setLayout(new BorderLayout()); setTitle("Image Loading"); setVisible(true); myLabel = new JLabel("Please Wait...", JLabel.CENTER); myLabel.setBackground(Color.WHITE); myLabel.setOpaque(true); getContentPane().add(myLabel, BorderLayout.CENTER); } public void run() { System.out.println("run"); while (running) { try { Thread.sleep(250); myLabel.setForeground(Color.RED); } catch (InterruptedException ie) {} try { Thread.sleep(250); myLabel.setForeground(Color.BLACK); } catch (InterruptedException ie) {} } } static public void stopRunning() { running = false; } }