public void InitUI() 
    {
        // Initializing button images
        try {
             Image img = ImageIO.read(getClass().getResource("/karel/guipics/stop.png"));
             Stop.setIcon(new ImageIcon(img));
            } catch (IOException ex) {}
        try {
             Image img = ImageIO.read(getClass().getResource("/karel/guipics/pause.png"));
             Pause.setIcon(new ImageIcon(img));
            } catch (IOException ex) {}
        try {
             Image img = ImageIO.read(getClass().getResource("/karel/guipics/slower.png"));
             Slowdown.setIcon(new ImageIcon(img));
            } catch (IOException ex) {}
        try {
             Image img = ImageIO.read(getClass().getResource("/karel/guipics/faster.png"));
             Speedup.setIcon(new ImageIcon(img));
            } catch (IOException ex) {}
        try {
             Image img = ImageIO.read(getClass().getResource("/karel/guipics/go.png"));
             jButton4.setIcon(new ImageIcon(img));
            } catch (IOException ex) {}
        try {
             Image img = ImageIO.read(getClass().getResource("/karel/guipics/right.png"));
             jButton6.setIcon(new ImageIcon(img));
            } catch (IOException ex) {}
        try {
             Image img = ImageIO.read(getClass().getResource("/karel/guipics/left.png"));
             jButton5.setIcon(new ImageIcon(img));
            } catch (IOException ex) {}
        Pause.setText("Pause");
        Pause.setFont(new Font("Arial", Font.PLAIN, 0));
        
        blankPanel.setVisible(true);
        lastPane = buttonPanel;
        hidePanels(lastPane);
        logText.setEditable(false);
        // Creating the popout frame with line numbering
        programmerFrame = new JInternalFrame("Programmer Mode");
        // Building Menu
        JMenuBar textbar;
        JButton menuSave, menuSaveAs, menuLoad;
        JButton menuRun;
        textbar = new JMenuBar();
        menuRun = new JButton("Run");
        menuRun.setFont(new Font("Arial", Font.PLAIN, 10));
        menuRun.setMinimumSize(new Dimension(75, 25));  
        menuRun.setPreferredSize(new Dimension(75, 25));
        menuRun.setMaximumSize(new Dimension(75, 25));
        textbar.add(menuRun);

        menuSaveAs = new JButton("Auto Save");
        menuSaveAs.setFont(new Font("Arial", Font.PLAIN, 10));
        menuSaveAs.setMinimumSize(new Dimension(90, 25));  
        menuSaveAs.setPreferredSize(new Dimension(90, 25));
        menuSaveAs.setMaximumSize(new Dimension(90, 25));
        textbar.add(menuSaveAs);

        menuSave = new JButton("Save As");
        menuSave.setFont(new Font("Arial", Font.PLAIN, 10));
        menuSave.setMinimumSize(new Dimension(75, 25));  
        menuSave.setPreferredSize(new Dimension(75, 25));
        menuSave.setMaximumSize(new Dimension(75, 25));        
        textbar.add(menuSave);
        
        menuLoad = new JButton("Load");
        menuLoad.setFont(new Font("Arial", Font.PLAIN, 10));
        menuLoad.setMinimumSize(new Dimension(75, 25));  
        menuLoad.setPreferredSize(new Dimension(75, 25));
        menuLoad.setMaximumSize(new Dimension(75, 25));        
        textbar.add(menuLoad);
        
        // Creating the JTextArea's
        programmerFrame.setJMenuBar(textbar);
//            programmerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JScrollPane textpane = new JScrollPane();
        programmerText = new JTextArea();
        lines = new JTextArea("1");
        // Listening for input and adding lines
        programmerText.getDocument().addDocumentListener(new DocumentListener()
            {
                    public String getText()
                    {
                            int caretPosition = programmerText.getDocument().getLength();
                            Element root = programmerText.getDocument().getDefaultRootElement();
                            String text = "1" + System.getProperty("line.separator");
                            for(int i = 2; i < root.getElementIndex( caretPosition ) + 2; i++)
                            {
                                    text += i + System.getProperty("line.separator");
                            }
                            return text;
                    }
                    @Override
                    public void changedUpdate(DocumentEvent de) {
                            lines.setText(getText());
                    }

                    @Override
                    public void insertUpdate(DocumentEvent de) {
                            lines.setText(getText());
                    }

                    @Override
                    public void removeUpdate(DocumentEvent de) {
                            lines.setText(getText());
                    }

            });

        textpane.getViewport().add(programmerText);
        textpane.setRowHeaderView(lines);
        textpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

        programmerFrame.add(textpane);
        programmerFrame.pack();
        programmerFrame.setSize(390,540);
        programmerFrame.setVisible(false);
        blankPanel.add(programmerFrame);
        // Setting it to fill all of the space in the pane
        try{programmerFrame.setMaximum(true);}
        catch(Exception e){};
        // Removing the title bar of the programmerframe
        ((javax.swing.plaf.basic.BasicInternalFrameUI)programmerFrame.getUI())
                                                            .setNorthPane(null);
        lines.setBackground(Color.LIGHT_GRAY);
        lines.setEditable(false);
        menuRun.addActionListener(new ActionListener() 
        {
               @Override
               public void actionPerformed(java.awt.event.ActionEvent e)
               {
                        programmerRunButton(e);
               }




            });
        menuSave.addActionListener(new ActionListener() 
            {
               @Override
               public void actionPerformed(java.awt.event.ActionEvent e)
               {
                    programmerSaveButton(e);                   
               }                       
            });
        
        menuLoad.addActionListener(new ActionListener() 
            {
               @Override
               public void actionPerformed(java.awt.event.ActionEvent e)
               {
                    programmerLoadButton(e);                   
               }                       
            });        

        menuSaveAs.addActionListener(new ActionListener() 
            {
               @Override
               public void actionPerformed(java.awt.event.ActionEvent e)
               {
                   programmerAutosaveButton(e);
               }                       
            });      

    }