private void PicButtonActionPerformed(ActionEvent evt) {
      OKButton.setEnabled(true);
      javax.swing.Icon test = PicButton.getIcon();
      if (test instanceof ImageIcon) {
        if (isBIFpic) {
          String BIFFILENAME = "po_" + tmpname + "l.tga";
          try {
            InfoText.setText(BIFFILENAME);

            File tempImage = RESFAC.TempImageFile(BIFFILENAME);
            if (tempImage != null) {
              TargaImage curtga = new TargaImage(tempImage);
              CurrentPortrait.setIcon(new ImageIcon(curtga.getImage()));
              BICPortraitname = "po_" + tmpname;
              CURRENTPORTRAIT = tempImage.getParent() + FileDelim + baseFilename;
              OKButton.setEnabled(true);
            }
          } catch (IOException err) {
            JOptionPane.showMessageDialog(
                null,
                "Fatal Error - " + BIFFILENAME + " not found. Your data files might be corrupt.",
                "Error",
                0);
            System.exit(0);
          }
        } else {
          String PORTRAIT = qualifiedName;
          if (qualifiedName.toUpperCase().endsWith("M.TGA")) {
            CURRENTPORTRAIT = PORTRAIT;
            PORTRAIT = qualifiedName.substring(0, qualifiedName.length() - 5) + "l.tga";
          }

          ImageIcon icon = null;
          try {
            icon = new ImageIcon(new TargaImage(new File(PORTRAIT)).getImage());
          } catch (IOException e) {
            System.out.println("Invalid Icon: " + PORTRAIT);
            icon = null;
          }

          CurrentPortrait.setIcon(icon);
          BICPortraitname = baseFilename.substring(0, baseFilename.length() - 4);
          InfoText.setText(PORTRAIT.substring(PORTRAIT.lastIndexOf(FileDelim) + 1));
          if (BICPortraitname.toLowerCase().endsWith("m")
              || BICPortraitname.toLowerCase().endsWith("l")
              || BICPortraitname.toLowerCase().endsWith("h")
              || BICPortraitname.toLowerCase().endsWith("s")
              || BICPortraitname.toLowerCase().endsWith("t")) {
            BICPortraitname = BICPortraitname.substring(0, BICPortraitname.length() - 1);
          }
          OKButton.setEnabled(true);
        }
      }
    }
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  private void initComponents() { // GEN-BEGIN:initComponents
    java.awt.GridBagConstraints gridBagConstraints;

    CurrentPortrait = new javax.swing.JLabel();
    RaceCheck = new javax.swing.JCheckBox();
    SexCheck = new javax.swing.JCheckBox();
    PortraitScrollPane = new javax.swing.JScrollPane();
    PortraitsWindow = new javax.swing.JPanel();
    OKButton = new javax.swing.JButton();
    CancelButton = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    jPanel6 = new javax.swing.JPanel();
    jPanel7 = new javax.swing.JPanel();
    InfoText = new javax.swing.JTextField();
    FirstButton = new javax.swing.JButton();
    BackButton = new javax.swing.JButton();
    ForwardButton = new javax.swing.JButton();
    LastButton = new javax.swing.JButton();
    jPanel8 = new javax.swing.JPanel();
    jPanel9 = new javax.swing.JPanel();

    getContentPane().setLayout(new java.awt.GridBagLayout());

    setTitle("Portraits");
    setName("PortFrame");
    setResizable(false);
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            exitForm(evt);
          }
        });

    CurrentPortrait.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/CharacterCreator/resource/portrait.jpg")));
    CurrentPortrait.setVerticalAlignment(javax.swing.SwingConstants.TOP);
    CurrentPortrait.setMaximumSize(new java.awt.Dimension(128, 200));
    CurrentPortrait.setMinimumSize(new java.awt.Dimension(128, 200));
    CurrentPortrait.setPreferredSize(new java.awt.Dimension(128, 200));
    CurrentPortrait.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    getContentPane().add(CurrentPortrait, gridBagConstraints);

    RaceCheck.setSelected(true);
    RaceCheck.setText("Lock To Race");
    RaceCheck.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            RaceCheckActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    getContentPane().add(RaceCheck, gridBagConstraints);

    SexCheck.setSelected(true);
    SexCheck.setText("Lock to Gender");
    SexCheck.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            SexCheckActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    getContentPane().add(SexCheck, gridBagConstraints);

    PortraitScrollPane.setHorizontalScrollBarPolicy(
        javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    PortraitScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_NEVER);
    PortraitScrollPane.setMinimumSize(new java.awt.Dimension(640, 500));
    PortraitScrollPane.setPreferredSize(new java.awt.Dimension(658, 500));
    PortraitScrollPane.setAutoscrolls(true);
    PortraitsWindow.setLayout(new java.awt.GridLayout(0, 10));

    PortraitsWindow.setMaximumSize(new java.awt.Dimension(640, 500));
    PortraitsWindow.setMinimumSize(new java.awt.Dimension(640, 500));
    PortraitScrollPane.setViewportView(PortraitsWindow);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 6;
    gridBagConstraints.gridheight = 9;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(PortraitScrollPane, gridBagConstraints);

    OKButton.setText("OK");
    OKButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            OKButtonActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 10;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
    getContentPane().add(OKButton, gridBagConstraints);

    CancelButton.setText("Cancel");
    CancelButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            CancelButtonActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(CancelButton, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    getContentPane().add(jPanel1, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    getContentPane().add(jPanel2, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 12;
    getContentPane().add(jPanel3, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 0;
    getContentPane().add(jPanel4, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 5;
    getContentPane().add(jPanel5, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    getContentPane().add(jPanel6, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 7;
    getContentPane().add(jPanel7, gridBagConstraints);

    InfoText.setBackground(new java.awt.Color(204, 204, 204));
    InfoText.setFont(new java.awt.Font("Dialog", 0, 10));
    InfoText.setForeground(new java.awt.Color(255, 0, 0));
    InfoText.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    InfoText.setBorder(null);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
    getContentPane().add(InfoText, gridBagConstraints);

    FirstButton.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/CharacterCreator/resource/first.gif")));
    FirstButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            FirstButtonActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 11;
    getContentPane().add(FirstButton, gridBagConstraints);

    BackButton.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/CharacterCreator/resource/back.gif")));
    BackButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            BackButtonActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 11;
    getContentPane().add(BackButton, gridBagConstraints);

    ForwardButton.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/CharacterCreator/resource/forward.gif")));
    ForwardButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            ForwardButtonActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 7;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    getContentPane().add(ForwardButton, gridBagConstraints);

    LastButton.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/CharacterCreator/resource/last.gif")));
    LastButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            LastButtonActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 8;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    getContentPane().add(LastButton, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.ipadx = 4;
    gridBagConstraints.insets = new java.awt.Insets(0, 85, 0, 85);
    getContentPane().add(jPanel8, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 6;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.insets = new java.awt.Insets(0, 25, 0, 25);
    getContentPane().add(jPanel9, gridBagConstraints);

    pack();
  } // GEN-END:initComponents