Program: 49953
Project: 49953
Buggy source:
/** 
 * Setting up the window and rules
 */
public void initComponents(){
  setLayout(new GridBagLayout());
  setSize(600,600);
  setBorder(BorderFactory.createLoweredBevelBorder());
  GridBagConstraints c=new GridBagConstraints();
  final Board[] boards=b.getBoards();
  final JPanel legalDestWhiteCheckBox=new JPanel();
  legalDestWhiteCheckBox.setLayout(new GridLayout(2,1));
  final JCheckBox wCaptureMand=new JCheckBox("String_Node_Str");
  wCaptureMand.setToolTipText("String_Node_Str");
  legalDestWhiteCheckBox.add(wCaptureMand);
  final JCheckBox wNoMoveObj=new JCheckBox("String_Node_Str");
  wNoMoveObj.setToolTipText("String_Node_Str");
  if (whiteRules.theEndIsNigh().equals("String_Node_Str") || whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    legalDestWhiteCheckBox.add(wNoMoveObj);
  }
  final JPanel afterCaptureWhiteCheckBox=new JPanel();
  afterCaptureWhiteCheckBox.setLayout(new GridLayout(4,1));
  final JCheckBox wChangeColor=new JCheckBox("String_Node_Str");
  wChangeColor.setToolTipText("String_Node_Str");
  if (!whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCaptureWhiteCheckBox.add(wChangeColor);
  }
  final JCheckBox wPieceReturn=new JCheckBox("String_Node_Str");
  wPieceReturn.setToolTipText("String_Node_Str");
  afterCaptureWhiteCheckBox.add(wPieceReturn);
  final JCheckBox wDrop=new JCheckBox("String_Node_Str");
  wDrop.setToolTipText("String_Node_Str");
  if (!whiteRules.theEndIsNigh().equals("String_Node_Str") || !whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCaptureWhiteCheckBox.add(wDrop);
  }
  final JCheckBox wCapturedColorAndDrop=new JCheckBox("String_Node_Str");
  wCapturedColorAndDrop.setToolTipText("String_Node_Str");
  afterCaptureWhiteCheckBox.add(wCapturedColorAndDrop);
  final JPanel legalDestBlackCheckBox=new JPanel();
  legalDestBlackCheckBox.setLayout(new GridLayout(2,1));
  final JCheckBox bCaptureMand=new JCheckBox("String_Node_Str");
  bCaptureMand.setToolTipText("String_Node_Str");
  legalDestBlackCheckBox.add(bCaptureMand);
  final JCheckBox bNoMoveObj=new JCheckBox("String_Node_Str");
  bNoMoveObj.setToolTipText("String_Node_Str");
  if (blackRules.theEndIsNigh().equals("String_Node_Str") || blackRules.theEndIsNigh().equals("String_Node_Str")) {
    legalDestBlackCheckBox.add(bNoMoveObj);
  }
  final JPanel afterCapturepBlackCheckBox=new JPanel();
  afterCapturepBlackCheckBox.setLayout(new GridLayout(4,1));
  final JCheckBox bChangeColor=new JCheckBox("String_Node_Str");
  bChangeColor.setToolTipText("String_Node_Str");
  if (!blackRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCapturepBlackCheckBox.add(bChangeColor);
  }
  final JCheckBox bPieceReturn=new JCheckBox("String_Node_Str");
  bPieceReturn.setToolTipText("String_Node_Str");
  afterCapturepBlackCheckBox.add(bPieceReturn);
  final JCheckBox bDrop=new JCheckBox("String_Node_Str");
  bDrop.setToolTipText("String_Node_Str");
  if (!blackRules.theEndIsNigh().equals("String_Node_Str") || !blackRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCapturepBlackCheckBox.add(bDrop);
  }
  final JCheckBox bCapturedColorAndDrop=new JCheckBox("String_Node_Str");
  bCapturedColorAndDrop.setToolTipText("String_Node_Str");
  afterCapturepBlackCheckBox.add(bCapturedColorAndDrop);
  final JPanel sCheckBox=new JPanel();
  sCheckBox.setLayout(new GridLayout(2,1));
  final JCheckBox atomic=new JCheckBox("String_Node_Str");
  atomic.setToolTipText("String_Node_Str");
  sCheckBox.add(atomic);
  final JCheckBox switchBoard=new JCheckBox("String_Node_Str");
  switchBoard.setToolTipText("String_Node_Str");
  switchBoard.setEnabled(false);
  sCheckBox.add(switchBoard);
  final JPanel wExtras=new JPanel();
  wExtras.setLayout(new GridBagLayout());
  final JTextField wNumChecks=new JTextField(2);
  Object[] allPieces=PieceBuilder.getSet().toArray();
  final JComboBox wPiecesList=new JComboBox(allPieces);
  JLabel wChecksLabel=new JLabel("String_Node_Str");
  JLabel wPiecesLabel=new JLabel("String_Node_Str");
  wNumChecks.setVisible(false);
  wPiecesList.setVisible(false);
  if (whiteRules.theEndIsNigh().equals("String_Node_Str") || whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    if (whiteRules.theEndIsNigh().equals("String_Node_Str"))     wPiecesLabel.setText("String_Node_Str");
    wPiecesList.setVisible(true);
    wPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    wExtras.add(wPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    wExtras.add(wPiecesList,c);
  }
  if (whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    wNumChecks.setVisible(true);
    wPiecesList.setVisible(true);
    wPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=0;
    wExtras.add(wChecksLabel,c);
    c.gridx=1;
    c.gridy=0;
    wExtras.add(wNumChecks,c);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    wExtras.add(wPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    wExtras.add(wPiecesList,c);
  }
  final JPanel bExtras=new JPanel();
  bExtras.setLayout(new GridBagLayout());
  final JTextField bNumChecks=new JTextField(2);
  final JComboBox bPiecesList=new JComboBox(allPieces);
  JLabel bChecksLabel=new JLabel("String_Node_Str");
  JLabel bPiecesLabel=new JLabel("String_Node_Str");
  bNumChecks.setVisible(false);
  bPiecesList.setVisible(false);
  if (blackRules.theEndIsNigh().equals("String_Node_Str") || blackRules.theEndIsNigh().equals("String_Node_Str")) {
    if (blackRules.theEndIsNigh().equals("String_Node_Str"))     bPiecesLabel.setText("String_Node_Str");
    bPiecesList.setVisible(true);
    bPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    bExtras.add(bPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    bExtras.add(bPiecesList,c);
  }
  if (blackRules.theEndIsNigh().equals("String_Node_Str")) {
    bNumChecks.setVisible(true);
    bPiecesList.setVisible(true);
    bPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=0;
    bExtras.add(bChecksLabel,c);
    c.gridx=1;
    c.gridy=0;
    bExtras.add(bNumChecks,c);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    bExtras.add(bPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    bExtras.add(bPiecesList,c);
  }
  final JButton back=new JButton("String_Node_Str");
  back.setToolTipText("String_Node_Str");
  back.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      Driver.getInstance().setPanel(new ObjectiveMaker(b));
    }
  }
);
  JButton save=new JButton("String_Node_Str");
  save.setToolTipText("String_Node_Str");
  save.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      if (wCaptureMand.isSelected()) {
        whiteRules.addAdjustTeamDests(new AdjustTeamDests("String_Node_Str"));
      }
      if (wNoMoveObj.isSelected()) {
        whiteRules.addCropLegalDests("String_Node_Str");
      }
      if (wChangeColor.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (wPieceReturn.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (wDrop.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (wCapturedColorAndDrop.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (bCaptureMand.isSelected()) {
        blackRules.addAdjustTeamDests(new AdjustTeamDests("String_Node_Str"));
      }
      if (bNoMoveObj.isSelected()) {
        blackRules.addCropLegalDests("String_Node_Str");
      }
      if (bChangeColor.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (bPieceReturn.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (bDrop.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (bCapturedColorAndDrop.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (switchBoard.isSelected() && boards.length == 2) {
        whiteRules.setGetBoard(new GetBoard("String_Node_Str"));
        blackRules.setGetBoard(new GetBoard("String_Node_Str"));
      }
      if (atomic.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
        blackRules.addAfterMove("String_Node_Str");
      }
      if (wNumChecks.isVisible()) {
        String wNumChecked=wNumChecks.getText();
        try {
          int answer=Integer.parseInt(wNumChecked);
          if (answer < 1) {
            JOptionPane.showMessageDialog(null,"String_Node_Str");
            return;
          }
          whiteRules.addEndOfGame(new EndOfGame("String_Node_Str",false,answer,"String_Node_Str"));
        }
 catch (        Exception ne) {
          JOptionPane.showMessageDialog(null,"String_Node_Str");
          return;
        }
      }
      if (bNumChecks.isVisible()) {
        String bNumChecked=bNumChecks.getText();
        try {
          int answer=Integer.parseInt(bNumChecked);
          if (answer < 1) {
            JOptionPane.showMessageDialog(null,"String_Node_Str");
            return;
          }
          blackRules.addEndOfGame(new EndOfGame("String_Node_Str",false,answer,"String_Node_Str"));
        }
 catch (        Exception ne) {
          JOptionPane.showMessageDialog(null,"String_Node_Str");
          return;
        }
      }
      if (wPiecesList.isVisible()) {
        if (whiteRules.theEndIsNigh().equals("String_Node_Str")) {
          whiteRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,"String_Node_Str"));
          whiteRules.setObjectivePiece(new ObjectivePiece("String_Node_Str",wPiecesList.getSelectedItem().toString()));
        }
 else {
          whiteRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,wPiecesList.getSelectedItem().toString()));
        }
      }
      if (bPiecesList.isVisible()) {
        bPiecesList.getSelectedItem();
        if (blackRules.theEndIsNigh().equals("String_Node_Str")) {
          blackRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,"String_Node_Str"));
          blackRules.setObjectivePiece(new ObjectivePiece("String_Node_Str",bPiecesList.getSelectedItem().toString()));
        }
 else {
          blackRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,bPiecesList.getSelectedItem().toString()));
        }
      }
      Driver.getInstance().setPanel(new PlayerCustomMenu(b,whiteRules,blackRules));
    }
  }
);
  JPanel whiteTeam=new JPanel();
  whiteTeam.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  whiteTeam.setLayout(new GridBagLayout());
  JPanel whiteLegalDests=new JPanel();
  whiteLegalDests.setLayout(new GridBagLayout());
  c.gridx=0;
  c.gridy=1;
  whiteLegalDests.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  whiteLegalDests.add(legalDestWhiteCheckBox,c);
  c.gridx=0;
  c.gridy=0;
  whiteTeam.add(whiteLegalDests,c);
  c.insets=new Insets(1,3,3,3);
  c.gridx=0;
  c.gridy=1;
  whiteTeam.add(wExtras,c);
  JPanel whiteCapture=new JPanel();
  whiteCapture.setLayout(new GridBagLayout());
  c.gridheight=1;
  c.gridx=0;
  c.gridy=1;
  whiteCapture.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  whiteCapture.add(afterCaptureWhiteCheckBox,c);
  c.gridx=0;
  c.gridy=2;
  whiteTeam.add(whiteCapture,c);
  JPanel blackTeam=new JPanel();
  blackTeam.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  blackTeam.setLayout(new GridBagLayout());
  JPanel blackLegalDests=new JPanel();
  blackLegalDests.setLayout(new GridBagLayout());
  c.gridx=0;
  c.gridy=1;
  blackLegalDests.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  blackLegalDests.add(legalDestBlackCheckBox,c);
  c.gridx=0;
  c.gridy=0;
  blackTeam.add(blackLegalDests,c);
  JPanel blackCapture=new JPanel();
  blackCapture.setLayout(new GridBagLayout());
  c.gridheight=1;
  c.gridx=0;
  c.gridy=1;
  blackCapture.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  blackCapture.add(afterCapturepBlackCheckBox,c);
  c.insets=new Insets(1,3,3,3);
  c.gridx=0;
  c.gridy=1;
  blackTeam.add(bExtras,c);
  c.gridx=0;
  c.gridy=2;
  blackTeam.add(blackCapture,c);
  c.insets=new Insets(5,5,5,5);
  c.gridx=0;
  c.gridy=0;
  add(whiteTeam,c);
  c.insets=new Insets(5,5,5,5);
  c.gridx=1;
  c.gridy=0;
  add(blackTeam,c);
  JPanel specialRules=new JPanel();
  specialRules.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  specialRules.setLayout(new GridBagLayout());
  c.gridx=0;
  c.gridy=1;
  specialRules.add(sCheckBox,c);
  c.gridx=0;
  c.gridy=2;
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=1;
  c.gridwidth=2;
  add(specialRules,c);
  JPanel buttons=new JPanel();
  buttons.setLayout(new FlowLayout());
  buttons.add(back);
  buttons.add(save);
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=2;
  c.gridwidth=2;
  add(buttons,c);
  wChangeColor.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wChangeColor.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
      }
    }
  }
);
  bChangeColor.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bChangeColor.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
      }
    }
  }
);
  wPieceReturn.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wPieceReturn.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        wCapturedColorAndDrop.setEnabled(false);
        wCapturedColorAndDrop.setSelected(false);
        wDrop.setEnabled(false);
        wDrop.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        wCapturedColorAndDrop.setEnabled(true);
        wDrop.setEnabled(true);
      }
    }
  }
);
  bPieceReturn.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bPieceReturn.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        bCapturedColorAndDrop.setEnabled(false);
        bCapturedColorAndDrop.setSelected(false);
        bDrop.setEnabled(false);
        bDrop.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        bCapturedColorAndDrop.setEnabled(true);
        bDrop.setEnabled(true);
      }
    }
  }
);
  atomic.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (atomic.isSelected()) {
        wChangeColor.setEnabled(false);
        wChangeColor.setSelected(false);
        bChangeColor.setEnabled(false);
        bChangeColor.setSelected(false);
        wCapturedColorAndDrop.setEnabled(false);
        wCapturedColorAndDrop.setSelected(false);
        bCapturedColorAndDrop.setEnabled(false);
        bCapturedColorAndDrop.setSelected(false);
        wDrop.setEnabled(false);
        wDrop.setSelected(false);
        bDrop.setEnabled(false);
        bDrop.setSelected(false);
        wPieceReturn.setEnabled(false);
        wPieceReturn.setSelected(false);
        bPieceReturn.setEnabled(false);
        bPieceReturn.setSelected(false);
      }
 else {
        wChangeColor.setEnabled(true);
        bChangeColor.setEnabled(true);
        wCapturedColorAndDrop.setEnabled(true);
        bCapturedColorAndDrop.setEnabled(true);
        wDrop.setEnabled(true);
        bDrop.setEnabled(true);
        wPieceReturn.setEnabled(true);
        bPieceReturn.setEnabled(true);
      }
    }
  }
);
  wCapturedColorAndDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wCapturedColorAndDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        wDrop.setEnabled(false);
        wDrop.setSelected(false);
        wPieceReturn.setEnabled(false);
        wPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        wDrop.setEnabled(true);
        wPieceReturn.setEnabled(true);
      }
    }
  }
);
  bCapturedColorAndDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bCapturedColorAndDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        bDrop.setEnabled(false);
        bDrop.setSelected(false);
        bPieceReturn.setEnabled(false);
        bPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        bDrop.setEnabled(true);
        bPieceReturn.setEnabled(true);
      }
    }
  }
);
  wDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        wCapturedColorAndDrop.setEnabled(false);
        wCapturedColorAndDrop.setSelected(false);
        wPieceReturn.setEnabled(false);
        wPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        wCapturedColorAndDrop.setEnabled(true);
        wPieceReturn.setEnabled(true);
      }
    }
  }
);
  bDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        bCapturedColorAndDrop.setEnabled(false);
        bCapturedColorAndDrop.setSelected(false);
        bPieceReturn.setEnabled(false);
        bPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        bCapturedColorAndDrop.setEnabled(true);
        bPieceReturn.setEnabled(true);
      }
    }
  }
);
  if (boards.length == 2) {
    switchBoard.setEnabled(true);
  }
}

Fixed version (ground truth):
/** 
 * Setting up the window and rules
 */
public void initComponents(){
  setLayout(new GridBagLayout());
  setSize(600,600);
  setBorder(BorderFactory.createLoweredBevelBorder());
  GridBagConstraints c=new GridBagConstraints();
  final Board[] boards=b.getBoards();
  final JPanel legalDestWhiteCheckBox=new JPanel();
  legalDestWhiteCheckBox.setLayout(new GridLayout(2,1));
  final JCheckBox wCaptureMand=new JCheckBox("String_Node_Str");
  wCaptureMand.setToolTipText("String_Node_Str");
  legalDestWhiteCheckBox.add(wCaptureMand);
  final JCheckBox wNoMoveObj=new JCheckBox("String_Node_Str");
  wNoMoveObj.setToolTipText("String_Node_Str");
  if (whiteRules.theEndIsNigh().equals("String_Node_Str") || whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    legalDestWhiteCheckBox.add(wNoMoveObj);
  }
  final JPanel afterCaptureWhiteCheckBox=new JPanel();
  afterCaptureWhiteCheckBox.setLayout(new GridLayout(4,1));
  final JCheckBox wChangeColor=new JCheckBox("String_Node_Str");
  wChangeColor.setToolTipText("String_Node_Str");
  if (!whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCaptureWhiteCheckBox.add(wChangeColor);
  }
  final JCheckBox wPieceReturn=new JCheckBox("String_Node_Str");
  wPieceReturn.setToolTipText("String_Node_Str");
  afterCaptureWhiteCheckBox.add(wPieceReturn);
  final JCheckBox wDrop=new JCheckBox("String_Node_Str");
  wDrop.setToolTipText("String_Node_Str");
  if (!whiteRules.theEndIsNigh().equals("String_Node_Str") || !whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCaptureWhiteCheckBox.add(wDrop);
  }
  final JCheckBox wCapturedColorAndDrop=new JCheckBox("String_Node_Str");
  wCapturedColorAndDrop.setToolTipText("String_Node_Str");
  afterCaptureWhiteCheckBox.add(wCapturedColorAndDrop);
  final JPanel legalDestBlackCheckBox=new JPanel();
  legalDestBlackCheckBox.setLayout(new GridLayout(2,1));
  final JCheckBox bCaptureMand=new JCheckBox("String_Node_Str");
  bCaptureMand.setToolTipText("String_Node_Str");
  legalDestBlackCheckBox.add(bCaptureMand);
  final JCheckBox bNoMoveObj=new JCheckBox("String_Node_Str");
  bNoMoveObj.setToolTipText("String_Node_Str");
  if (blackRules.theEndIsNigh().equals("String_Node_Str") || blackRules.theEndIsNigh().equals("String_Node_Str")) {
    legalDestBlackCheckBox.add(bNoMoveObj);
  }
  final JPanel afterCapturepBlackCheckBox=new JPanel();
  afterCapturepBlackCheckBox.setLayout(new GridLayout(4,1));
  final JCheckBox bChangeColor=new JCheckBox("String_Node_Str");
  bChangeColor.setToolTipText("String_Node_Str");
  if (!blackRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCapturepBlackCheckBox.add(bChangeColor);
  }
  final JCheckBox bPieceReturn=new JCheckBox("String_Node_Str");
  bPieceReturn.setToolTipText("String_Node_Str");
  afterCapturepBlackCheckBox.add(bPieceReturn);
  final JCheckBox bDrop=new JCheckBox("String_Node_Str");
  bDrop.setToolTipText("String_Node_Str");
  if (!blackRules.theEndIsNigh().equals("String_Node_Str") || !blackRules.theEndIsNigh().equals("String_Node_Str")) {
    afterCapturepBlackCheckBox.add(bDrop);
  }
  final JCheckBox bCapturedColorAndDrop=new JCheckBox("String_Node_Str");
  bCapturedColorAndDrop.setToolTipText("String_Node_Str");
  afterCapturepBlackCheckBox.add(bCapturedColorAndDrop);
  final JPanel sCheckBox=new JPanel();
  sCheckBox.setLayout(new GridLayout(2,1));
  final JCheckBox atomic=new JCheckBox("String_Node_Str");
  atomic.setToolTipText("String_Node_Str");
  sCheckBox.add(atomic);
  final JCheckBox switchBoard=new JCheckBox("String_Node_Str");
  switchBoard.setToolTipText("String_Node_Str");
  switchBoard.setEnabled(false);
  sCheckBox.add(switchBoard);
  final JPanel wExtras=new JPanel();
  wExtras.setLayout(new GridBagLayout());
  final JTextField wNumChecks=new JTextField(2);
  Object[] allPieces=PieceBuilder.getSet().toArray();
  final JComboBox wPiecesList=new JComboBox(allPieces);
  JLabel wChecksLabel=new JLabel("String_Node_Str");
  JLabel wPiecesLabel=new JLabel("String_Node_Str");
  wNumChecks.setVisible(false);
  wPiecesList.setVisible(false);
  if (whiteRules.theEndIsNigh().equals("String_Node_Str") || whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    if (whiteRules.theEndIsNigh().equals("String_Node_Str"))     wPiecesLabel.setText("String_Node_Str");
    wPiecesList.setVisible(true);
    wPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    wExtras.add(wPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    wExtras.add(wPiecesList,c);
  }
  if (whiteRules.theEndIsNigh().equals("String_Node_Str")) {
    wNumChecks.setVisible(true);
    wPiecesList.setVisible(true);
    wPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=0;
    wExtras.add(wChecksLabel,c);
    c.gridx=1;
    c.gridy=0;
    wExtras.add(wNumChecks,c);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    wExtras.add(wPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    wExtras.add(wPiecesList,c);
  }
  final JPanel bExtras=new JPanel();
  bExtras.setLayout(new GridBagLayout());
  final JTextField bNumChecks=new JTextField(2);
  final JComboBox bPiecesList=new JComboBox(allPieces);
  JLabel bChecksLabel=new JLabel("String_Node_Str");
  JLabel bPiecesLabel=new JLabel("String_Node_Str");
  bNumChecks.setVisible(false);
  bPiecesList.setVisible(false);
  if (blackRules.theEndIsNigh().equals("String_Node_Str") || blackRules.theEndIsNigh().equals("String_Node_Str")) {
    if (blackRules.theEndIsNigh().equals("String_Node_Str"))     bPiecesLabel.setText("String_Node_Str");
    bPiecesList.setVisible(true);
    bPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    bExtras.add(bPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    bExtras.add(bPiecesList,c);
  }
  if (blackRules.theEndIsNigh().equals("String_Node_Str")) {
    bNumChecks.setVisible(true);
    bPiecesList.setVisible(true);
    bPiecesList.setSelectedIndex(4);
    c.gridx=0;
    c.gridy=0;
    bExtras.add(bChecksLabel,c);
    c.gridx=1;
    c.gridy=0;
    bExtras.add(bNumChecks,c);
    c.gridx=0;
    c.gridy=1;
    c.insets=new Insets(1,1,1,1);
    bExtras.add(bPiecesLabel,c);
    c.gridx=1;
    c.gridy=1;
    bExtras.add(bPiecesList,c);
  }
  final JButton back=new JButton("String_Node_Str");
  back.setToolTipText("String_Node_Str");
  back.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      Driver.getInstance().setPanel(new ObjectiveMaker(b));
    }
  }
);
  JButton save=new JButton("String_Node_Str");
  save.setToolTipText("String_Node_Str");
  save.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      if (wCaptureMand.isSelected()) {
        whiteRules.addAdjustTeamDests(new AdjustTeamDests("String_Node_Str"));
      }
      if (wNoMoveObj.isSelected()) {
        whiteRules.addCropLegalDests("String_Node_Str");
      }
      if (wChangeColor.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (wPieceReturn.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (wDrop.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (wCapturedColorAndDrop.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
      }
      if (bCaptureMand.isSelected()) {
        blackRules.addAdjustTeamDests(new AdjustTeamDests("String_Node_Str"));
      }
      if (bNoMoveObj.isSelected()) {
        blackRules.addCropLegalDests("String_Node_Str");
      }
      if (bChangeColor.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (bPieceReturn.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (bDrop.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (bCapturedColorAndDrop.isSelected()) {
        blackRules.addAfterMove("String_Node_Str");
      }
      if (switchBoard.isSelected() && boards.length == 2) {
        whiteRules.setGetBoard(new GetBoard("String_Node_Str"));
        blackRules.setGetBoard(new GetBoard("String_Node_Str"));
      }
      if (atomic.isSelected()) {
        whiteRules.addAfterMove("String_Node_Str");
        blackRules.addAfterMove("String_Node_Str");
      }
      if (wNumChecks.isVisible()) {
        String wNumChecked=wNumChecks.getText();
        try {
          int answer=Integer.parseInt(wNumChecked);
          if (answer < 1) {
            JOptionPane.showMessageDialog(null,"String_Node_Str");
            return;
          }
          whiteRules.addEndOfGame(new EndOfGame("String_Node_Str",false,answer,"String_Node_Str",false));
        }
 catch (        Exception ne) {
          JOptionPane.showMessageDialog(null,"String_Node_Str");
          return;
        }
      }
      if (bNumChecks.isVisible()) {
        String bNumChecked=bNumChecks.getText();
        try {
          int answer=Integer.parseInt(bNumChecked);
          if (answer < 1) {
            JOptionPane.showMessageDialog(null,"String_Node_Str");
            return;
          }
          blackRules.addEndOfGame(new EndOfGame("String_Node_Str",false,answer,"String_Node_Str",true));
        }
 catch (        Exception ne) {
          JOptionPane.showMessageDialog(null,"String_Node_Str");
          return;
        }
      }
      if (wPiecesList.isVisible()) {
        if (whiteRules.theEndIsNigh().equals("String_Node_Str")) {
          whiteRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,"String_Node_Str",false));
          whiteRules.setObjectivePiece(new ObjectivePiece("String_Node_Str",wPiecesList.getSelectedItem().toString()));
        }
 else {
          whiteRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,wPiecesList.getSelectedItem().toString(),false));
        }
      }
      if (bPiecesList.isVisible()) {
        bPiecesList.getSelectedItem();
        if (blackRules.theEndIsNigh().equals("String_Node_Str")) {
          blackRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,"String_Node_Str",true));
          blackRules.setObjectivePiece(new ObjectivePiece("String_Node_Str",bPiecesList.getSelectedItem().toString()));
        }
 else {
          blackRules.addEndOfGame(new EndOfGame("String_Node_Str",false,0,bPiecesList.getSelectedItem().toString(),true));
        }
      }
      Driver.getInstance().setPanel(new PlayerCustomMenu(b,whiteRules,blackRules));
    }
  }
);
  JPanel whiteTeam=new JPanel();
  whiteTeam.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  whiteTeam.setLayout(new GridBagLayout());
  JPanel whiteLegalDests=new JPanel();
  whiteLegalDests.setLayout(new GridBagLayout());
  c.gridx=0;
  c.gridy=1;
  whiteLegalDests.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  whiteLegalDests.add(legalDestWhiteCheckBox,c);
  c.gridx=0;
  c.gridy=0;
  whiteTeam.add(whiteLegalDests,c);
  c.insets=new Insets(1,3,3,3);
  c.gridx=0;
  c.gridy=1;
  whiteTeam.add(wExtras,c);
  JPanel whiteCapture=new JPanel();
  whiteCapture.setLayout(new GridBagLayout());
  c.gridheight=1;
  c.gridx=0;
  c.gridy=1;
  whiteCapture.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  whiteCapture.add(afterCaptureWhiteCheckBox,c);
  c.gridx=0;
  c.gridy=2;
  whiteTeam.add(whiteCapture,c);
  JPanel blackTeam=new JPanel();
  blackTeam.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  blackTeam.setLayout(new GridBagLayout());
  JPanel blackLegalDests=new JPanel();
  blackLegalDests.setLayout(new GridBagLayout());
  c.gridx=0;
  c.gridy=1;
  blackLegalDests.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  blackLegalDests.add(legalDestBlackCheckBox,c);
  c.gridx=0;
  c.gridy=0;
  blackTeam.add(blackLegalDests,c);
  JPanel blackCapture=new JPanel();
  blackCapture.setLayout(new GridBagLayout());
  c.gridheight=1;
  c.gridx=0;
  c.gridy=1;
  blackCapture.add(new JLabel("String_Node_Str"),c);
  c.gridx=0;
  c.gridy=2;
  blackCapture.add(afterCapturepBlackCheckBox,c);
  c.insets=new Insets(1,3,3,3);
  c.gridx=0;
  c.gridy=1;
  blackTeam.add(bExtras,c);
  c.gridx=0;
  c.gridy=2;
  blackTeam.add(blackCapture,c);
  c.insets=new Insets(5,5,5,5);
  c.gridx=0;
  c.gridy=0;
  add(whiteTeam,c);
  c.insets=new Insets(5,5,5,5);
  c.gridx=1;
  c.gridy=0;
  add(blackTeam,c);
  JPanel specialRules=new JPanel();
  specialRules.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  specialRules.setLayout(new GridBagLayout());
  c.gridx=0;
  c.gridy=1;
  specialRules.add(sCheckBox,c);
  c.gridx=0;
  c.gridy=2;
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=1;
  c.gridwidth=2;
  add(specialRules,c);
  JPanel buttons=new JPanel();
  buttons.setLayout(new FlowLayout());
  buttons.add(back);
  buttons.add(save);
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridx=0;
  c.gridy=2;
  c.gridwidth=2;
  add(buttons,c);
  wChangeColor.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wChangeColor.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
      }
    }
  }
);
  bChangeColor.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bChangeColor.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
      }
    }
  }
);
  wPieceReturn.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wPieceReturn.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        wCapturedColorAndDrop.setEnabled(false);
        wCapturedColorAndDrop.setSelected(false);
        wDrop.setEnabled(false);
        wDrop.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        wCapturedColorAndDrop.setEnabled(true);
        wDrop.setEnabled(true);
      }
    }
  }
);
  bPieceReturn.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bPieceReturn.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        bCapturedColorAndDrop.setEnabled(false);
        bCapturedColorAndDrop.setSelected(false);
        bDrop.setEnabled(false);
        bDrop.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        bCapturedColorAndDrop.setEnabled(true);
        bDrop.setEnabled(true);
      }
    }
  }
);
  atomic.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (atomic.isSelected()) {
        wChangeColor.setEnabled(false);
        wChangeColor.setSelected(false);
        bChangeColor.setEnabled(false);
        bChangeColor.setSelected(false);
        wCapturedColorAndDrop.setEnabled(false);
        wCapturedColorAndDrop.setSelected(false);
        bCapturedColorAndDrop.setEnabled(false);
        bCapturedColorAndDrop.setSelected(false);
        wDrop.setEnabled(false);
        wDrop.setSelected(false);
        bDrop.setEnabled(false);
        bDrop.setSelected(false);
        wPieceReturn.setEnabled(false);
        wPieceReturn.setSelected(false);
        bPieceReturn.setEnabled(false);
        bPieceReturn.setSelected(false);
      }
 else {
        wChangeColor.setEnabled(true);
        bChangeColor.setEnabled(true);
        wCapturedColorAndDrop.setEnabled(true);
        bCapturedColorAndDrop.setEnabled(true);
        wDrop.setEnabled(true);
        bDrop.setEnabled(true);
        wPieceReturn.setEnabled(true);
        bPieceReturn.setEnabled(true);
      }
    }
  }
);
  wCapturedColorAndDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wCapturedColorAndDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        wDrop.setEnabled(false);
        wDrop.setSelected(false);
        wPieceReturn.setEnabled(false);
        wPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        wDrop.setEnabled(true);
        wPieceReturn.setEnabled(true);
      }
    }
  }
);
  bCapturedColorAndDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bCapturedColorAndDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        bDrop.setEnabled(false);
        bDrop.setSelected(false);
        bPieceReturn.setEnabled(false);
        bPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        bDrop.setEnabled(true);
        bPieceReturn.setEnabled(true);
      }
    }
  }
);
  wDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (wDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        wCapturedColorAndDrop.setEnabled(false);
        wCapturedColorAndDrop.setSelected(false);
        wPieceReturn.setEnabled(false);
        wPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        wCapturedColorAndDrop.setEnabled(true);
        wPieceReturn.setEnabled(true);
      }
    }
  }
);
  bDrop.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (bDrop.isSelected()) {
        atomic.setEnabled(false);
        atomic.setSelected(false);
        bCapturedColorAndDrop.setEnabled(false);
        bCapturedColorAndDrop.setSelected(false);
        bPieceReturn.setEnabled(false);
        bPieceReturn.setSelected(false);
      }
 else {
        atomic.setEnabled(true);
        bCapturedColorAndDrop.setEnabled(true);
        bPieceReturn.setEnabled(true);
      }
    }
  }
);
  if (boards.length == 2) {
    switchBoard.setEnabled(true);
  }
}