public void panelWelcome() throws IOException {
    GridBagConstraints layoutConstraints = new GridBagConstraints();
    
    JLabel icon = new JLabel(getImage("resources/icon.png", 200));
    JLabel title = new JLabel("Welcome to JImageViewer!");
    title.setFont(new Font("Droid Sans", Font.BOLD, 54));
    title.setHorizontalAlignment(SwingConstants.CENTER);
    JLabel intro = new JLabel("<html><br>You are using JImageViewer, the Java Image Viewer. Please select a folder for your images:<br><br></html>");
    intro.setHorizontalAlignment(SwingConstants.CENTER);
    JButton dir = new JButton("Choose another directory");
    final JFileChooser newdir = new JFileChooser();
    newdir.setCurrentDirectory(new File(options.get(3)));
    newdir.setDialogTitle("Open Image Folder");
    newdir.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = 0;
    this.add(icon, layoutConstraints);
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = 1;
    this.add(title, layoutConstraints);
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = 2;
    this.add(intro, layoutConstraints);
    
    String rawRecent = options.get(5);
    final ArrayList<String> recent = new ArrayList<String>();
    int start = 0;
    for(int i=0; i<rawRecent.length(); i++) {
      if(rawRecent.charAt(i) == ',') {
        recent.add(rawRecent.substring(start, i));
        if(i<rawRecent.length()) {
          start = i + 1;
        }
      }
    }
    recent.add(rawRecent.substring(start, rawRecent.length()));
    
    int recentY = 3;
    for(final String currentRecent : recent) {
      final JLabel recentItemIcon = new JLabel(getImage("resources/folder.png", 50));
      recentItemIcon.setHorizontalAlignment(SwingConstants.LEFT);
      JButton recentItemTitle = new JButton(currentRecent);
      recentItemTitle.setFont(new Font("Droid Sans", Font.BOLD, 22));
      recentItemTitle.setHorizontalAlignment(SwingConstants.LEFT);
      recentItemTitle.setBorderPainted(false);
      recentItemTitle.setOpaque(false);
      recentItemTitle.setContentAreaFilled(false);
      recentItemTitle.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          try {
            writePreference(configPath, 16, "    <value>" + currentRecent + "</value>");
            options = parseXML(configPath);
            panelMain();
          } catch (IOException e) {
            JOptionPane.showMessageDialog(WindowPanel.this, "Error loading folder", "Load Images", JOptionPane.ERROR_MESSAGE);
          }
        }
      });
      
      layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
      layoutConstraints.gridx = 0;
      layoutConstraints.gridy = recentY;
      layoutConstraints.insets = new Insets(0, 300, 0, 0);
      this.add(recentItemIcon, layoutConstraints);
      layoutConstraints.insets = new Insets(0, 375, 0, 0);
      this.add(recentItemTitle, layoutConstraints);
      
      recentY = recentY + 1;
      if(recentY == 7) {
        break;
      }
    }
    
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = recentY;
    this.add(new JLabel("<html> <br></html>"), layoutConstraints);
    
    dir.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        int returnVal = newdir.showOpenDialog(WindowPanel.this);
        
        if(returnVal==JFileChooser.APPROVE_OPTION) {
          try {
            writePreference(configPath, 16, "    <value>" + newdir.getSelectedFile().getAbsolutePath() + "</value>");
            if(!recent.contains(newdir.getSelectedFile().getAbsolutePath())) {
              writePreference(configPath, 24, "    <value>" + newdir.getSelectedFile().getAbsolutePath() + "," + options.get(5) + "</value>");
            }
            options = parseXML(configPath);
            panelMain();
          } catch (IOException e) {
            JOptionPane.showMessageDialog(WindowPanel.this, "Error loading folder", "Load Images", JOptionPane.ERROR_MESSAGE);
          }
        }
      }
    });
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = recentY + 1;
    layoutConstraints.insets = new Insets(0, 350, 0, 350);
    this.add(dir, layoutConstraints);
    
    JButton preferences = new JButton("Preferences");
    preferences.addActionListener(new ActionListener() { 
      public void actionPerformed(ActionEvent e) {
        popupPreferences();
        options = parseXML(configPath);
        fileIndex = indexFiles(options.get(3));
      }
    });
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = recentY + 2;
    layoutConstraints.insets = new Insets(0, 350, 0, 350);
    this.add(preferences, layoutConstraints);
    
    JButton quit = new JButton("Quit");
    quit.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        System.exit(0);
      }
    });
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = recentY + 3;
    layoutConstraints.insets = new Insets(0, 350, 0, 350);
    this.add(quit, layoutConstraints);
  }