public void init() {
        try {           
            logOnConsole = Boolean.valueOf(getParameter("CONSOLELOGGING"));
            hideCADButton = Boolean.valueOf(getParameter("HIDECAD"));
            path = getDocumentBase();
            writeline("");
            writeline("Loading UI...");
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            writeline("Initializing...");
            String[] args = getArgs();
            Color c;
            if (getParameter("BACKCOLOR") != null) {
                String s = getParameter("BACKCOLOR");
                String[] vals = s.split(":");
                if (vals.length == 3 && vals[0].length() == 2
                        && vals[1].length() == 2 && vals[2].length() == 2) {
                    c = new Color(Integer.parseInt(vals[0], 16), Integer
                            .parseInt(vals[1], 16), Integer.parseInt(vals[2],
                            16));
                } else {
                    c = Color.WHITE;
                }
            } else {
                c = Color.WHITE;
            }
            this.setBackground(c);
            writeline("Starting main...");
            main = new Main(args, this, this);
            writeline("Creating controls...");
            controls = new VNCControls(main, background, c, !hideCADButton);
            writeline("Adding controls...");
            background.add(controls);
            this.add(background);

            errorPanel.setBackground(c);
            errorPanel.setLayout(new BorderLayout());
            console.setBackground(Color.white);
            console.setEditable(false);
            JScrollPane areaScrollPane = new JScrollPane(console);
            areaScrollPane
                    .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
            areaScrollPane.setBorder(BorderFactory.createLineBorder(
                    Color.BLACK, 1));
            errorPanel.add(areaScrollPane, BorderLayout.CENTER);
        } catch (Exception e) {
            writeline(e.getMessage());
        }

    }