Program: 49974
Project: 49974
Buggy source:
/** 
 * Initialize components of the GUI Create all the GUI components, set their specific properties and add them to the  window. Also add any necessary ActionListeners.
 */
private void initComponents(){
  setTitle("String_Node_Str");
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  setSize(325,340);
  setLocationRelativeTo(null);
  setResizable(false);
  setLayout(new FlowLayout());
  setResizable(true);
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e);
  }
  mainPanel=new JPanel();
  mainPanel.setBorder(BorderFactory.createLoweredBevelBorder());
  BufferedImage temp=null;
  try {
    temp=ImageIO.read(new File("String_Node_Str"));
  }
 catch (  IOException e1) {
    System.out.println("String_Node_Str");
    e1.printStackTrace();
  }
  ImageIcon picture=new ImageIcon(temp);
  JLabel pictureHolder=new JLabel();
  picture.setImage(picture.getImage().getScaledInstance(300,200,Image.SCALE_SMOOTH));
  pictureHolder.setIcon(picture);
  newGame=new JButton("String_Node_Str");
  newGame.setToolTipText("String_Node_Str");
  newGame.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      helpMenu.setText("String_Node_Str");
      gamePlayHelp.setVisible(true);
      gameInfo.setVisible(true);
      remove(mainPanel);
      otherPanel=new NewGameMenu();
      add(otherPanel);
      pack();
    }
  }
);
  continueGame=new JButton("String_Node_Str");
  continueGame.setToolTipText("String_Node_Str");
  continueGame.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      try {
        File dir=new File("String_Node_Str");
        String[] files=dir.list();
        if (files == null) {
          JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
          return;
        }
        String choice=(String)JOptionPane.showInputDialog(Driver.getInstance(),"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,files,null);
        if (choice == null)         return;
        FileInputStream f_in=new FileInputStream(new File("String_Node_Str" + choice));
        ObjectInputStream obj_in=new ObjectInputStream(f_in);
        Game toPlay=(Game)obj_in.readObject();
        helpMenu.setText("String_Node_Str");
        gameInfo.setVisible(true);
        gamePlayHelp.setVisible(true);
        gameOptions.setVisible(true);
        remove(mainPanel);
        otherPanel=new PlayGame(toPlay,false);
        add(otherPanel);
        pack();
      }
 catch (      Exception e) {
        JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
);
  viewGame=new JButton("String_Node_Str");
  viewGame.setToolTipText("String_Node_Str");
  viewGame.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      try {
        File dir=new File("String_Node_Str");
        String[] files=dir.list();
        if (files == null) {
          JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
          return;
        }
        String choice=(String)JOptionPane.showInputDialog(Driver.getInstance(),"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,files,null);
        if (choice == null)         return;
        File file=new File("String_Node_Str" + choice);
        Game toView;
        if (choice.endsWith("String_Node_Str")) {
          otherPanel=new PlayGame(true,file);
        }
 else {
          FileInputStream f_in=new FileInputStream(file);
          ObjectInputStream obj_in=new ObjectInputStream(f_in);
          toView=(Game)obj_in.readObject();
          otherPanel=new PlayGame(toView,true);
        }
        completedHelp.setVisible(true);
        helpMenu.setText("String_Node_Str");
        ;
        remove(mainPanel);
        add(otherPanel);
        pack();
      }
 catch (      Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
);
  createType=new JButton("String_Node_Str");
  createType.setToolTipText("String_Node_Str");
  createType.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      variantHelp.setVisible(true);
      helpMenu.setText("String_Node_Str");
      remove(mainPanel);
      otherPanel=new NewTypeMenu();
      add(otherPanel);
      pack();
    }
  }
);
  menuBar=new JMenuBar();
  JMenu fileMenu=new JMenu("String_Node_Str");
  fileMenu.setForeground(Color.WHITE);
  fileMenu.setMnemonic('F');
  helpMenu=new JMenu("String_Node_Str");
  helpMenu.setForeground(Color.white);
  helpMenu.setMnemonic('H');
  JMenuItem helpMenuItem=new JMenuItem("String_Node_Str",KeyEvent.VK_H);
  helpMenuItem.setToolTipText("String_Node_Str");
  BufferedImage help=null;
  try {
    help=ImageIO.read(new File("String_Node_Str"));
  }
 catch (  IOException e1) {
    System.out.println("String_Node_Str");
    e1.printStackTrace();
  }
  final ImageIcon helpPicture=new ImageIcon(help);
  helpPicture.setImage(helpPicture.getImage().getScaledInstance(600,600,Image.SCALE_SMOOTH));
  helpMenuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str","String_Node_Str",0,helpPicture);
    }
  }
);
  helpMenu.add(helpMenuItem);
  gamePlayHelp=new JMenuItem("String_Node_Str",KeyEvent.VK_G);
  gamePlayHelp.setToolTipText("String_Node_Str");
  gamePlayHelp.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str","String_Node_Str",1);
    }
  }
);
  helpMenu.add(gamePlayHelp);
  gamePlayHelp.setVisible(false);
  gameInfo=new JMenuItem("String_Node_Str",KeyEvent.VK_I);
  gameInfo.setToolTipText("String_Node_Str");
  gameInfo.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
    }
  }
);
  helpMenu.add(gameInfo);
  gameInfo.setVisible(false);
  variantHelp=new JMenuItem("String_Node_Str",KeyEvent.VK_V);
  variantHelp.setToolTipText("String_Node_Str");
  variantHelp.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str",1);
    }
  }
);
  helpMenu.add(variantHelp);
  variantHelp.setVisible(false);
  completedHelp=new JMenuItem("String_Node_Str",KeyEvent.VK_R);
  completedHelp.setToolTipText("String_Node_Str");
  completedHelp.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str" + "String_Node_Str");
    }
  }
);
  helpMenu.add(completedHelp);
  completedHelp.setVisible(false);
  JMenuItem newGameItem=new JMenuItem("String_Node_Str",KeyEvent.VK_N);
  newGameItem.setToolTipText("String_Node_Str");
  newGameItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      variantHelp.setVisible(false);
      helpMenu.setText("String_Node_Str");
      gamePlayHelp.setVisible(true);
      gameInfo.setVisible(true);
      if (otherPanel != null)       remove(otherPanel);
      if (mainPanel != null)       remove(mainPanel);
      otherPanel=new NewGameMenu();
      add(otherPanel);
      gamePlayHelp.setVisible(true);
      gameInfo.setVisible(true);
      pack();
    }
  }
);
  fileMenu.add(newGameItem);
  JMenuItem mainMenu=new JMenuItem("String_Node_Str",KeyEvent.VK_M);
  mainMenu.setToolTipText("String_Node_Str");
  mainMenu.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      helpMenu.setText("String_Node_Str");
      variantHelp.setVisible(false);
      gameInfo.setVisible(false);
      gamePlayHelp.setVisible(false);
      completedHelp.setVisible(false);
      if (gameOptions != null)       gameOptions.setVisible(false);
      if (otherPanel != null)       remove(otherPanel);
      add(mainPanel);
      pack();
    }
  }
);
  fileMenu.add(mainMenu);
  JMenuItem exitMenuItem=new JMenuItem("String_Node_Str",KeyEvent.VK_Q);
  exitMenuItem.setToolTipText("String_Node_Str");
  exitMenuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int answer=JOptionPane.showConfirmDialog(null,"String_Node_Str","String_Node_Str",1);
      if (answer == 0)       System.exit(0);
    }
  }
);
  fileMenu.add(exitMenuItem);
  menuBar.add(fileMenu);
  menuBar.add(helpMenu);
  setJMenuBar(menuBar);
  mainPanel.setLayout(new GridBagLayout());
  GridBagConstraints c=new GridBagConstraints();
  c.fill=GridBagConstraints.HORIZONTAL;
  c.weightx=0.0;
  c.gridwidth=3;
  c.gridx=0;
  c.gridy=0;
  mainPanel.add(pictureHolder,c);
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=1;
  c.gridwidth=2;
  mainPanel.add(newGame,c);
  c.gridx=2;
  c.gridy=1;
  c.gridwidth=1;
  mainPanel.add(createType,c);
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=2;
  c.gridwidth=2;
  mainPanel.add(continueGame,c);
  c.gridx=2;
  c.gridy=2;
  c.gridwidth=1;
  mainPanel.add(viewGame,c);
  add(mainPanel);
  setVisible(true);
}

Fixed version (ground truth):
/** 
 * Initialize components of the GUI Create all the GUI components, set their specific properties and add them to the  window. Also add any necessary ActionListeners.
 */
private void initComponents(){
  setTitle("String_Node_Str");
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  setSize(325,340);
  setLocationRelativeTo(null);
  setResizable(false);
  setLayout(new FlowLayout());
  setResizable(true);
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e);
  }
  mainPanel=new JPanel();
  mainPanel.setBorder(BorderFactory.createLoweredBevelBorder());
  BufferedImage temp=null;
  try {
    temp=ImageIO.read(new File("String_Node_Str"));
  }
 catch (  IOException e1) {
    System.out.println("String_Node_Str");
    e1.printStackTrace();
  }
  ImageIcon picture=new ImageIcon(temp);
  JLabel pictureHolder=new JLabel();
  picture.setImage(picture.getImage().getScaledInstance(300,200,Image.SCALE_SMOOTH));
  pictureHolder.setIcon(picture);
  newGame=new JButton("String_Node_Str");
  newGame.setToolTipText("String_Node_Str");
  newGame.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      helpMenu.setText("String_Node_Str");
      gamePlayHelp.setVisible(true);
      gameInfo.setVisible(true);
      remove(mainPanel);
      otherPanel=new NewGameMenu();
      add(otherPanel);
      pack();
    }
  }
);
  continueGame=new JButton("String_Node_Str");
  continueGame.setToolTipText("String_Node_Str");
  continueGame.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      try {
        File dir=new File("String_Node_Str");
        String[] files=dir.list();
        if (files == null) {
          JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
          return;
        }
        String choice=(String)JOptionPane.showInputDialog(Driver.getInstance(),"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,files,null);
        if (choice == null)         return;
        FileInputStream f_in=new FileInputStream(new File("String_Node_Str" + choice));
        ObjectInputStream obj_in=new ObjectInputStream(f_in);
        Game toPlay=(Game)obj_in.readObject();
        helpMenu.setText("String_Node_Str");
        gameInfo.setVisible(true);
        gamePlayHelp.setVisible(true);
        gameOptions.setVisible(true);
        remove(mainPanel);
        otherPanel=new PlayGame(toPlay,false);
        add(otherPanel);
        pack();
      }
 catch (      Exception e) {
        JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
);
  viewGame=new JButton("String_Node_Str");
  viewGame.setToolTipText("String_Node_Str");
  viewGame.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      try {
        File dir=new File("String_Node_Str");
        String[] files=dir.list();
        if (files == null) {
          JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
          return;
        }
        String choice=(String)JOptionPane.showInputDialog(Driver.getInstance(),"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,files,null);
        if (choice == null)         return;
        File file=new File("String_Node_Str" + choice);
        Game toView;
        if (choice.endsWith("String_Node_Str")) {
          otherPanel=new PlayGame(true,file);
        }
 else {
          FileInputStream f_in=new FileInputStream(file);
          ObjectInputStream obj_in=new ObjectInputStream(f_in);
          toView=(Game)obj_in.readObject();
          otherPanel=new PlayGame(toView,true);
        }
        completedHelp.setVisible(true);
        helpMenu.setText("String_Node_Str");
        ;
        remove(mainPanel);
        add(otherPanel);
        pack();
      }
 catch (      Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
);
  createType=new JButton("String_Node_Str");
  createType.setToolTipText("String_Node_Str");
  createType.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      variantHelp.setVisible(true);
      helpMenu.setText("String_Node_Str");
      remove(mainPanel);
      otherPanel=new NewTypeMenu();
      add(otherPanel);
      pack();
    }
  }
);
  menuBar=new JMenuBar();
  JMenu fileMenu=new JMenu("String_Node_Str");
  fileMenu.setForeground(Color.WHITE);
  fileMenu.setMnemonic('F');
  helpMenu=new JMenu("String_Node_Str");
  helpMenu.setForeground(Color.white);
  helpMenu.setMnemonic('H');
  JMenuItem helpMenuItem=new JMenuItem("String_Node_Str",KeyEvent.VK_H);
  helpMenuItem.setToolTipText("String_Node_Str");
  BufferedImage help=null;
  try {
    help=ImageIO.read(new File("String_Node_Str"));
  }
 catch (  IOException e1) {
    System.out.println("String_Node_Str");
    e1.printStackTrace();
  }
  final ImageIcon helpPicture=new ImageIcon(help);
  helpPicture.setImage(helpPicture.getImage().getScaledInstance(600,600,Image.SCALE_SMOOTH));
  helpMenuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str","String_Node_Str",0,helpPicture);
    }
  }
);
  helpMenu.add(helpMenuItem);
  gamePlayHelp=new JMenuItem("String_Node_Str",KeyEvent.VK_G);
  gamePlayHelp.setToolTipText("String_Node_Str");
  gamePlayHelp.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str","String_Node_Str",1);
    }
  }
);
  helpMenu.add(gamePlayHelp);
  gamePlayHelp.setVisible(false);
  gameInfo=new JMenuItem("String_Node_Str",KeyEvent.VK_I);
  gameInfo.setToolTipText("String_Node_Str");
  gameInfo.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
    }
  }
);
  helpMenu.add(gameInfo);
  gameInfo.setVisible(false);
  variantHelp=new JMenuItem("String_Node_Str",KeyEvent.VK_V);
  variantHelp.setToolTipText("String_Node_Str");
  variantHelp.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str",1);
    }
  }
);
  helpMenu.add(variantHelp);
  variantHelp.setVisible(false);
  completedHelp=new JMenuItem("String_Node_Str",KeyEvent.VK_R);
  completedHelp.setToolTipText("String_Node_Str");
  completedHelp.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      JOptionPane.showMessageDialog(Driver.this,"String_Node_Str" + "String_Node_Str");
    }
  }
);
  helpMenu.add(completedHelp);
  completedHelp.setVisible(false);
  JMenuItem newGameItem=new JMenuItem("String_Node_Str",KeyEvent.VK_N);
  newGameItem.setToolTipText("String_Node_Str");
  newGameItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      variantHelp.setVisible(false);
      helpMenu.setText("String_Node_Str");
      gamePlayHelp.setVisible(true);
      gameInfo.setVisible(true);
      if (PlayGame.menu != null)       PlayGame.menu.setVisible(false);
      if (otherPanel != null)       remove(otherPanel);
      if (mainPanel != null)       remove(mainPanel);
      otherPanel=new NewGameMenu();
      add(otherPanel);
      gamePlayHelp.setVisible(true);
      gameInfo.setVisible(true);
      pack();
    }
  }
);
  fileMenu.add(newGameItem);
  JMenuItem mainMenu=new JMenuItem("String_Node_Str",KeyEvent.VK_M);
  mainMenu.setToolTipText("String_Node_Str");
  mainMenu.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      helpMenu.setText("String_Node_Str");
      variantHelp.setVisible(false);
      gameInfo.setVisible(false);
      gamePlayHelp.setVisible(false);
      completedHelp.setVisible(false);
      if (gameOptions != null)       gameOptions.setVisible(false);
      if (otherPanel != null)       remove(otherPanel);
      add(mainPanel);
      pack();
    }
  }
);
  fileMenu.add(mainMenu);
  JMenuItem exitMenuItem=new JMenuItem("String_Node_Str",KeyEvent.VK_Q);
  exitMenuItem.setToolTipText("String_Node_Str");
  exitMenuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int answer=JOptionPane.showConfirmDialog(null,"String_Node_Str","String_Node_Str",1);
      if (answer == 0)       System.exit(0);
    }
  }
);
  fileMenu.add(exitMenuItem);
  menuBar.add(fileMenu);
  menuBar.add(helpMenu);
  setJMenuBar(menuBar);
  mainPanel.setLayout(new GridBagLayout());
  GridBagConstraints c=new GridBagConstraints();
  c.fill=GridBagConstraints.HORIZONTAL;
  c.weightx=0.0;
  c.gridwidth=3;
  c.gridx=0;
  c.gridy=0;
  mainPanel.add(pictureHolder,c);
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=1;
  c.gridwidth=2;
  mainPanel.add(newGame,c);
  c.gridx=2;
  c.gridy=1;
  c.gridwidth=1;
  mainPanel.add(createType,c);
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=2;
  c.gridwidth=2;
  mainPanel.add(continueGame,c);
  c.gridx=2;
  c.gridy=2;
  c.gridwidth=1;
  mainPanel.add(viewGame,c);
  add(mainPanel);
  setVisible(true);
}