Splash splash = new Splash(IconManager.getInstance().getIcon("splashscreen").getImage()); splash.show();
    public static void main(String[] args) {        boolean processLink = false;        String link = "";        if (args != null && args.length > 0) {            try {                for (int i=0; i<args.length; i++){                    if (args[i].indexOf("-path=")!=-1){                        System.setProperty("user.dir", args[i].substring(6));                        break;                    }                }                boolean hilfeAusgegeben = false;                for (int i=0; i<args.length; i++){                    if (args[i].compareTo("-help")==0){                        if (hilfeAusgegeben){                            continue;                        }                        System.out.println();                        System.out.println(" -help                       Diese Uebersicht.");                        System.out.println(" -path=<pfad>                Ausfuehrpfad setzen. Alles im GUI ist relativ zu diesem.");                        System.out.println(" -link=<md5Passwort|link>    ajfsp-Link ans GUI uebergeben. " +                                           " Das GUI wird ggf gestartet.");                        System.out.println();                        hilfeAusgegeben = true;                    }                    if (args[i].indexOf("-link=")!=-1){                        link = args[i].substring(6);                        int PORT = PropertiesManager.getOptionsManager().getLinkListenerPort();                        String passwort = PropertiesManager.getOptionsManager().                            getRemoteSettings().getOldPassword();                        Socket socket = new Socket("localhost", PORT);                        PrintStream out = new PrintStream(socket.getOutputStream());                        out.println(passwort + "|" + link);                        socket.close();                        System.exit(0);                    }                }            }            catch (IOException ioE) {                //Keine bisherige GUI-Instanz vorhanden, also GUI oeffnen                processLink = true;            }            catch(Exception e){                System.exit(1);            }        }        Logger rootLogger = Logger.getRootLogger();        logger = Logger.getLogger(AppleJuiceClient.class.getName());        try{            if (PropertiesManager.getOptionsManager().isThemesSupported()){                if (OS.isOneDotFour()) {                    java.lang.reflect.Method method = JFrame.class.                        getMethod("setDefaultLookAndFeelDecorated",                                  new Class[] {boolean.class});                    method.invoke(null, new Object[] {Boolean.TRUE});                    method = JDialog.class.                        getMethod("setDefaultLookAndFeelDecorated",                                  new Class[] {boolean.class});                    method.invoke(null, new Object[] {Boolean.TRUE});                }            }        }        catch(Exception e){            if (logger.isEnabledFor(Level.FATAL))                logger.fatal("Programmabbruch", e);        }        String datum = new SimpleDateFormat("ddMMyyyy_HHmmss").format(new Date(                System.currentTimeMillis()));        String dateiName;        dateiName = datum + ".html";        HTMLLayout layout = new HTMLLayout();        layout.setTitle("appleJuice-Core-GUI-Log " + datum);        layout.setLocationInfo(true);        try        {            String path = System.getProperty("user.dir") + File.separator +                    "logs";            File aFile = new File(path);            if (!aFile.exists())            {                aFile.mkdir();            }            FileAppender fileAppender = new FileAppender(layout,                                                         path + File.separator + dateiName);            rootLogger.addAppender(fileAppender);        }        catch (IOException ioe)        {            ioe.printStackTrace();        }        rootLogger.setLevel(PropertiesManager.getOptionsManager().getLogLevel());        try        {            String nachricht = "appleJuice-Core-GUI Version " + ApplejuiceFassade.GUI_VERSION + " wird gestartet...";            if (logger.isEnabledFor(Level.INFO))                logger.info(nachricht);            System.out.println(nachricht);            nachricht = "erkanntes GUI-OS: " + System.getProperty("os.name");            if (logger.isEnabledFor(Level.INFO))                logger.info(nachricht);            Frame dummyFrame = new Frame();            Image img = IconManager.getInstance().getIcon("applejuice").getImage();            dummyFrame.setIconImage(img);            String titel = null;            LanguageSelector languageSelector = LanguageSelector.getInstance();            QuickConnectionSettingsDialog remoteDialog = null;            int versuche = 0;            while (!ApplejuiceFassade.istCoreErreichbar())            {                versuche++;                titel = ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                          getFirstAttrbuteByTagName(new String[]{"mainform", "caption"}));                nachricht = ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "startup",                                                                                                     "fehlversuch"}));                SoundPlayer.getInstance().playSound(SoundPlayer.VERWEIGERT);                JOptionPane.showMessageDialog(dummyFrame, nachricht, titel,                                              JOptionPane.ERROR_MESSAGE);                remoteDialog = new QuickConnectionSettingsDialog(dummyFrame);                remoteDialog.show();                if (remoteDialog.getResult() == QuickConnectionSettingsDialog.ABGEBROCHEN)                {                    nachricht = ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                                  getFirstAttrbuteByTagName(new String[]{"javagui", "startup",                                                                                                         "verbindungsfehler"}));                    nachricht = nachricht.replaceFirst("%s",                                                       PropertiesManager.getOptionsManager().                                                       getRemoteSettings().                                                       getHost());                    JOptionPane.showMessageDialog(dummyFrame, nachricht, titel,                                                  JOptionPane.OK_OPTION);                    logger.fatal(nachricht);                    System.out.println("Fehler: " + nachricht);                    System.exit(-1);                }            }            if (versuche>0){                SoundPlayer.getInstance().playSound(SoundPlayer.ZUGANG_GEWAEHRT);            }            Splash splash = new Splash(IconManager.getInstance().getIcon("splashscreen").getImage());            splash.show();            PositionManager lm = PropertiesManager.getPositionManager();            final AppleJuiceDialog theApp = new AppleJuiceDialog();            if (lm.isLegal())            {                theApp.setLocation(lm.getMainXY());                theApp.setSize(lm.getMainDimension());            }            else            {                theApp.setLocation(20, 20);            }            theApp.show();            nachricht = "appleJuice-Core-GUI luft...";            if (logger.isEnabledFor(Level.INFO))                logger.info(nachricht);            System.out.println(nachricht);            splash.dispose();            LinkListener linkListener = new LinkListener();            if (processLink){                ApplejuiceFassade.getInstance().processLink(link);            }            if (PropertiesManager.getOptionsManager().isErsterStart())            {                WizardDialog wizardDialog = new WizardDialog(theApp, true);                Dimension appDimension = wizardDialog.getSize();                Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();                wizardDialog.setLocation((screenSize.width - appDimension.width) / 2,                                         (screenSize.height - appDimension.height) / 2);                wizardDialog.show();            }            Thread versionWorker = new Thread() {                public void run() {                    if (logger.isEnabledFor(Level.DEBUG))                        logger.debug("VersionWorkerThread gestartet. " + this);                    try                    {                        //http://download.berlios.de/applejuicejava/version.txt                        String strAktuellsteVersion = WebsiteContentLoader.getWebsiteContent("http://download.berlios.de", 80,                                                                                             "/applejuicejava/version.txt");                        if (strAktuellsteVersion.length() > 0)                        {                            int pos = ApplejuiceFassade.GUI_VERSION.indexOf(' ');                            double aktuelleVersion;                            if (pos != -1)                            {                                aktuelleVersion = Double.parseDouble(ApplejuiceFassade.GUI_VERSION.substring(0, pos));                            }                            else                            {                                aktuelleVersion = Double.parseDouble(ApplejuiceFassade.GUI_VERSION);                            }                            double aktuellsteVersion = Double.parseDouble(strAktuellsteVersion);                            if (aktuellsteVersion > aktuelleVersion)                            {                                LanguageSelector ls = LanguageSelector.getInstance();                                String titel = ls.getFirstAttrbuteByTagName(new String[]{"javagui", "startup", "newversiontitel"});                                String nachricht = ls.getFirstAttrbuteByTagName(new String[]{"javagui", "startup", "newversionnachricht"});                                nachricht = nachricht.replaceFirst("%s", strAktuellsteVersion);                                JOptionPane.showMessageDialog(theApp, nachricht, titel,                                                              JOptionPane.OK_OPTION | JOptionPane.INFORMATION_MESSAGE);                            }                        }                    }                    catch (Exception e)                    {                        if (logger.isEnabledFor(Level.INFO))                            logger.info("Aktualisierungsinformationen konnten nicht geladen werden. Server down?");                    }                    if (logger.isEnabledFor(Level.DEBUG))                        logger.debug("VersionWorkerThread beendet. " + this);                }            };            versionWorker.start();        }        catch (Exception e)        {            if (logger.isEnabledFor(Level.FATAL))                logger.fatal("Programmabbruch", e);            System.exit(-1);        }    }