Program: 84349
Project: 84349
Buggy source:
private void init(){
  setLayout(new BorderLayout());
  setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  bot.getScriptHandler().addScriptListener(ScriptSelector.this);
  addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    final WindowEvent e){
      bot.getScriptHandler().removeScriptListener(ScriptSelector.this);
      dispose();
    }
  }
);
  table=new JTable(model);
  table.addMouseListener(new MouseAdapter(){
    @Override public void mousePressed(    final MouseEvent e){
      if ((e.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) {
        final int row=table.rowAtPoint(e.getPoint());
        table.getSelectionModel().setSelectionInterval(row,row);
        showMenu(e);
      }
    }
    private void showMenu(    final MouseEvent e){
      final int row=table.rowAtPoint(e.getPoint());
      final ScriptDefinition def=model.getDefinition(row);
      final JPopupMenu contextMenu=new JPopupMenu();
      final JMenuItem visit=new JMenuItem();
      visit.setText("String_Node_Str");
      visit.setIcon(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_WEBLINK)));
      visit.addMouseListener(new MouseAdapter(){
        @Override public void mousePressed(        final MouseEvent e){
          BotGUI.openURL(def.website);
        }
      }
);
      final JMenuItem start=new JMenuItem();
      start.setText(submit.getText());
      start.setIcon(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_PLAY)));
      start.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          submit.doClick();
        }
      }
);
      start.setEnabled(submit.isEnabled());
      final JMenuItem delete=new JMenuItem();
      delete.setText("String_Node_Str");
      delete.setIcon(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_CLOSE)));
      delete.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          final File path=def.path == null || def.path.isEmpty() ? null : new File(def.path);
          if (path != null && path.exists() && path.delete()) {
            log.info("String_Node_Str" + def.name + "String_Node_Str"+ def.path+ "String_Node_Str");
          }
 else {
            log.warning("String_Node_Str" + def.name);
          }
        }
      }
);
      if (def.website == null || def.website.isEmpty()) {
        visit.setEnabled(false);
      }
      contextMenu.add(start);
      contextMenu.add(visit);
      contextMenu.add(delete);
      contextMenu.show(table,e.getX(),e.getY());
    }
  }
);
  table.setRowHeight(20);
  table.setIntercellSpacing(new Dimension(1,1));
  table.setShowGrid(false);
  table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  table.getSelectionModel().addListSelectionListener(new TableSelectionListener());
  setColumnWidths(table,30,175,50,100);
  final JToolBar toolBar=new JToolBar();
  toolBar.setMargin(new Insets(1,1,1,1));
  toolBar.setFloatable(false);
  search=new JTextField();
  final Color searchDefaultColor=search.getForeground(), searchAltColor=Color.GRAY;
  final String searchDefaultText="String_Node_Str";
  search.setText(searchDefaultText);
  search.setForeground(searchAltColor);
  search.addFocusListener(new FocusAdapter(){
    @Override public void focusGained(    final FocusEvent e){
      if (search.getForeground() == searchAltColor) {
        search.setText("String_Node_Str");
        search.setForeground(searchDefaultColor);
      }
      table.clearSelection();
    }
    @Override public void focusLost(    final FocusEvent e){
      if (search.getText().isEmpty()) {
        search.setText(searchDefaultText);
        search.setForeground(searchAltColor);
      }
    }
  }
);
  search.addKeyListener(new KeyAdapter(){
    @Override public void keyTyped(    final KeyEvent e){
      model.search(search.getText());
      table.revalidate();
    }
  }
);
  submit=new JButton("String_Node_Str",new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_PLAY)));
  final JButton connect=new JButton(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_CONNECT)));
  submit.setEnabled(false);
  submit.addActionListener(new ActionListener(){
    public void actionPerformed(    final ActionEvent evt){
      final ScriptDefinition def=model.getDefinition(table.getSelectedRow());
      try {
        bot.setAccount((String)accounts.getSelectedItem());
        bot.getScriptHandler().runScript(def.source.load(def));
        bot.getScriptHandler().removeScriptListener(ScriptSelector.this);
        dispose();
      }
 catch (      final ServiceException e) {
        e.printStackTrace();
      }
    }
  }
);
  connect.setEnabled(GlobalConfiguration.SCRIPT_DRM ? true : false);
  if (connect.isEnabled()) {
    final ActionListener listenConnect=new ActionListener(){
      public void actionPerformed(      final ActionEvent e){
        final String icon=connected ? GlobalConfiguration.Paths.Resources.ICON_DISCONNECT : GlobalConfiguration.Paths.Resources.ICON_CONNECT;
        connect.setIcon(new ImageIcon(GlobalConfiguration.getImage(icon)));
        connect.repaint();
        connected=!connected;
        load();
      }
    }
;
    connect.addActionListener(listenConnect);
  }
  accounts=new JComboBox(AccountManager.getAccountNames());
  accounts.setMinimumSize(new Dimension(200,20));
  accounts.setPreferredSize(new Dimension(200,20));
  toolBar.add(search);
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(accounts);
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(connect);
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(submit);
  final JPanel center=new JPanel();
  center.setLayout(new BorderLayout());
  final JScrollPane pane=new JScrollPane(table,ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  center.add(pane,BorderLayout.CENTER);
  add(center,BorderLayout.CENTER);
  add(toolBar,BorderLayout.SOUTH);
  setSize(750,400);
  setMinimumSize(getSize());
  setLocationRelativeTo(getParent());
  search.requestFocus();
}

Fixed version (ground truth):
private void init(){
  setLayout(new BorderLayout());
  setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  bot.getScriptHandler().addScriptListener(ScriptSelector.this);
  addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    final WindowEvent e){
      bot.getScriptHandler().removeScriptListener(ScriptSelector.this);
      dispose();
    }
  }
);
  table=new JTable(model);
  table.addMouseListener(new MouseAdapter(){
    @Override public void mousePressed(    final MouseEvent e){
      if ((e.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) {
        final int row=table.rowAtPoint(e.getPoint());
        table.getSelectionModel().setSelectionInterval(row,row);
        showMenu(e);
      }
    }
    private void showMenu(    final MouseEvent e){
      final int row=table.rowAtPoint(e.getPoint());
      final ScriptDefinition def=model.getDefinition(row);
      final JPopupMenu contextMenu=new JPopupMenu();
      final JMenuItem visit=new JMenuItem();
      visit.setText("String_Node_Str");
      visit.setIcon(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_WEBLINK)));
      visit.addMouseListener(new MouseAdapter(){
        @Override public void mousePressed(        final MouseEvent e){
          BotGUI.openURL(def.website);
        }
      }
);
      final JMenuItem start=new JMenuItem();
      start.setText(submit.getText());
      start.setIcon(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_PLAY)));
      start.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          submit.doClick();
        }
      }
);
      start.setEnabled(submit.isEnabled());
      final JMenuItem delete=new JMenuItem();
      delete.setText("String_Node_Str");
      delete.setIcon(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_CLOSE)));
      delete.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          final File path=def.path == null || def.path.isEmpty() ? null : new File(def.path);
          if (path != null && path.exists() && path.delete()) {
            log.info("String_Node_Str" + def.name + "String_Node_Str"+ def.path+ "String_Node_Str");
          }
 else {
            log.warning("String_Node_Str" + def.name);
          }
        }
      }
);
      if (def.website == null || def.website.isEmpty()) {
        visit.setEnabled(false);
      }
      contextMenu.add(start);
      contextMenu.add(visit);
      contextMenu.add(delete);
      contextMenu.show(table,e.getX(),e.getY());
    }
  }
);
  table.setRowHeight(20);
  table.setIntercellSpacing(new Dimension(1,1));
  table.setShowGrid(false);
  table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  table.getSelectionModel().addListSelectionListener(new TableSelectionListener());
  setColumnWidths(table,30,175,50,100);
  final JToolBar toolBar=new JToolBar();
  toolBar.setMargin(new Insets(1,1,1,1));
  toolBar.setFloatable(false);
  search=new JTextField();
  final Color searchDefaultColor=search.getForeground(), searchAltColor=Color.GRAY;
  final String searchDefaultText="String_Node_Str";
  search.setText(searchDefaultText);
  search.setForeground(searchAltColor);
  search.addFocusListener(new FocusAdapter(){
    @Override public void focusGained(    final FocusEvent e){
      if (search.getForeground() == searchAltColor) {
        search.setText("String_Node_Str");
        search.setForeground(searchDefaultColor);
      }
      table.clearSelection();
    }
    @Override public void focusLost(    final FocusEvent e){
      if (search.getText().isEmpty()) {
        search.setText(searchDefaultText);
        search.setForeground(searchAltColor);
      }
    }
  }
);
  search.addKeyListener(new KeyAdapter(){
    @Override public void keyTyped(    final KeyEvent e){
      model.search(search.getText());
      table.revalidate();
    }
  }
);
  submit=new JButton("String_Node_Str",new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_PLAY)));
  final JButton connect=new JButton(new ImageIcon(GlobalConfiguration.getImage(GlobalConfiguration.Paths.Resources.ICON_CONNECT)));
  submit.setEnabled(false);
  submit.addActionListener(new ActionListener(){
    public void actionPerformed(    final ActionEvent evt){
      final ScriptDefinition def=model.getDefinition(table.getSelectedRow());
      try {
        bot.setAccount((String)accounts.getSelectedItem());
        bot.getScriptHandler().runScript(def.source.load(def));
        bot.getScriptHandler().removeScriptListener(ScriptSelector.this);
        dispose();
      }
 catch (      final ServiceException e) {
        e.printStackTrace();
      }
    }
  }
);
  connect.setEnabled(GlobalConfiguration.SCRIPT_DRM ? true : false);
  if (connect.isEnabled()) {
    final ActionListener listenConnect=new ActionListener(){
      public void actionPerformed(      final ActionEvent e){
        final String icon=connected ? GlobalConfiguration.Paths.Resources.ICON_DISCONNECT : GlobalConfiguration.Paths.Resources.ICON_CONNECT;
        connect.setIcon(new ImageIcon(GlobalConfiguration.getImage(icon)));
        connect.repaint();
        connected=!connected;
        load();
      }
    }
;
    connect.addActionListener(listenConnect);
  }
  accounts=new JComboBox(AccountManager.getAccountNames());
  accounts.setMinimumSize(new Dimension(200,20));
  accounts.setPreferredSize(new Dimension(200,20));
  toolBar.add(search);
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(accounts);
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(connect);
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(submit);
  final JPanel center=new JPanel();
  center.setLayout(new BorderLayout());
  final JScrollPane pane=new JScrollPane(table,ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  center.add(pane,BorderLayout.CENTER);
  add(center,BorderLayout.CENTER);
  add(toolBar,BorderLayout.SOUTH);
  setSize(750,400);
  setMinimumSize(getSize());
  setLocationRelativeTo(getParent());
  search.requestFocus();
}