Advertisement
Lauda

Untitled

Dec 15th, 2013
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.32 KB | None | 0 0
  1. package gui;
  2.  
  3. import gui.settings.Config;
  4.  
  5. import java.awt.Image;
  6. import java.io.IOException;
  7. import java.net.MalformedURLException;
  8. import java.net.URL;
  9. import java.util.ArrayList;
  10. import java.util.List;
  11.  
  12. import javax.imageio.ImageIO;
  13. import javax.swing.SwingUtilities;
  14.  
  15.  
  16. public class Main {
  17.    
  18.     /**
  19.      * @param args
  20.      */
  21.     @SuppressWarnings("static-access")
  22.     public static void main(String[] args) {
  23.         final List<Image> icons = new ArrayList<Image>();
  24.         URL url16 = null;
  25.         URL url32 = null;
  26.        
  27.         try {
  28.             url16 = new URL("https://dl.dropboxusercontent.com/u/2844443/Slike/favicon16.png");
  29.             url32 = new URL("https://dl.dropboxusercontent.com/u/2844443/Slike/favicon32.png");
  30.         } catch (MalformedURLException e1) {
  31.             // TODO Auto-generated catch block
  32.             e1.printStackTrace();
  33.         }
  34.  
  35.         try {
  36.             icons.add(ImageIO.read(url16));
  37.             icons.add(ImageIO.read(url32));
  38.         } catch (IOException e) {
  39.             // TODO Auto-generated catch block
  40.             e.printStackTrace();
  41.         }
  42.        
  43.         if (!Config.isDisablesplash()) {
  44.             final Frame mf = Frame.getInstance();
  45.             final LoginForm lf = LoginForm.getInstance();
  46.             Splash s = new Splash();
  47.             s.setIconImages(icons);
  48.             s.setVisible(true);
  49.             Thread t = Thread.currentThread();
  50.            
  51.             try {
  52.                 t.sleep(5500);
  53.             } catch (InterruptedException e) {
  54.                 // TODO Auto-generated catch block
  55.                 e.printStackTrace();
  56.             }
  57.            
  58.             s.dispose(); // "Unistavamo" splash ekrean...
  59.             SwingUtilities.invokeLater(new Runnable() {
  60.                 public void run()
  61.                 {
  62.                     // Pokrecemo glavne procese...
  63.                     if (!Config.isDisablelogin()) {
  64.                     lf.setVisible(true);
  65.                     mf.setVisible(false);
  66.                     mf.setIconImages(icons);
  67.                     lf.setIconImages(icons);
  68.                     }
  69.                     else {
  70.                         lf.setVisible(false);
  71.                         mf.setVisible(true);
  72.                         mf.setIconImages(icons);
  73.                     }
  74.                 }
  75.             });
  76.  
  77.         }
  78.         else {
  79.             if (!Config.isDisablelogin()) {
  80.                 Frame mf = Frame.getInstance();
  81.                 LoginForm lf = LoginForm.getInstance();
  82.                 mf.setVisible(false);
  83.                 lf.setVisible(true);
  84.                 lf.setIconImages(icons);
  85.             }
  86.             else
  87.             {
  88.                 Frame mf = Frame.getInstance();
  89.                 mf.setVisible(true);
  90.                 mf.setIconImages(icons);
  91.             }
  92.         }
  93.         }
  94.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement