SHARE
TWEET

Untitled

a guest Nov 17th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import javax.swing.*;
  2.  
  3. public class FlashingText extends JApplet implements Runnable {
  4.  
  5.     private static final long serialVersionUID = 1L;
  6.     private JLabel            jlblText         = new JLabel("bro its easy :)))",JLabel.CENTER);
  7.  
  8.     public FlashingText() {
  9.         add(jlblText);
  10.         new Thread(this).start();
  11.     }
  12.  
  13.     @Override
  14.     public void run() {
  15.         try {
  16.             while(true) {
  17.                 if(jlblText.getText() == null) {
  18.                     jlblText.setText("Welcome");
  19.                     Thread.sleep(2000);
  20.                 } else
  21.                     jlblText.setText(null);
  22.             }
  23.         } catch(InterruptedException ex) {
  24.  
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top