Пример #1
0
    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);
        }
      }
    }
Пример #2
0
 public void enterCancelButton(Event ev) {
   if (ev.key == TAB) {
     if (ev.shiftDown()) OKButton.requestFocus();
     else nameField.requestFocus();
   }
   if (ev.key == NEWLINE) {
     handleEvent(new Event(this, Event.WINDOW_DESTROY, null));
   }
 } // enterCancelButton
Пример #3
0
 private void RaceButtonActionPerformed(ActionEvent evt) {
   int tmp = (new Integer(InfoNum.getText())).intValue();
   descstr = racialmap[tmp][racialtypes.Description];
   int descnum = ChkHex.ChkHex(descstr);
   // int descnum = (new Integer((String)racialmap[tmp].get(new
   // Integer(racialtypes.Description)))).intValue();
   DescriptionText.setText(TLKFAC.getEntry(descnum));
   DescriptionContainer.scrollRectToVisible(new Rectangle(10, 10));
   DescriptionContainer.getViewport().setViewPosition(new Point(0, 0)); // @DUG
   RACENUM = tmp;
   OKButton.setEnabled(true);
 }
Пример #4
0
 private void RecommendedButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_RecommendedButtonActionPerformed
   // Add your handling code here:
   // HUMAN IS DEFAULT RACE (RACE 6)
   descstr = racialmap[6][racialtypes.Description];
   int descnum = ChkHex.ChkHex(descstr);
   // int descnum = (new Integer((String)racialmap[6].get(new
   // Integer(racialtypes.Description)))).intValue();
   RACENUM = 6;
   DescriptionText.setText(TLKFAC.getEntry(descnum));
   OKButton.setEnabled(true);
 } // GEN-LAST:event_RecommendedButtonActionPerformed
Пример #5
0
  public LogonAppDemo() {

    super("LogonAppDemo window");
    setLayout(null); // added from the version 1.02 program
    name = "";
    password = "";

    addNotify();
    resize(insets().left + insets().right + 333, insets().top + insets().bottom + 222);
    nameField = new TextField(20);
    add(nameField);
    nameField.reshape(insets().left + 117, insets().top + 68, 167, 25);
    logonLabel = new Label("Identification and Logon");
    logonLabel.setFont(new Font("Helvetica", Font.BOLD, 14));
    add(logonLabel);
    logonLabel.reshape(insets().left + 72, insets().top + 23, 186, 18);
    nameLabel = new Label("Name:");
    nameLabel.setFont(new Font("Dialog", Font.BOLD, 12));
    add(nameLabel);
    nameLabel.reshape(insets().left + 39, insets().top + 73, 47, 18);
    passwordField = new TextField(20);
    add(passwordField);
    passwordField.reshape(insets().left + 117, insets().top + 107, 168, 25);
    OKButton = new Button("OK");
    OKButton.setFont(new Font("Dialog", Font.BOLD, 12));
    add(OKButton);
    OKButton.reshape(insets().left + 72, insets().top + 158, 75, 27);
    passwordLabel = new Label("Password:"******"Dialog", Font.BOLD, 12));
    add(passwordLabel);
    passwordLabel.reshape(insets().left + 39, insets().top + 112, 69, 16);
    cancelButton = new Button("Cancel");
    cancelButton.setFont(new Font("Dialog", Font.BOLD, 12));
    add(cancelButton);
    cancelButton.reshape(insets().left + 186, insets().top + 156, 75, 29);

    show();
  } // LogonAppDemo
Пример #6
0
  /** Creates new form RaceMenu1 */
  public RaceMenu() {
    RACENUM = 6;
    initComponents();
    OKButton.setEnabled(false);
    DescriptionContainer.setViewportView(DescriptionText);

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    if ((screenSize.getWidth() > getContentPane().getWidth())
        && (screenSize.getHeight() > getContentPane().getHeight())) {
      int intwidth =
          new Double(((screenSize.getWidth() - getContentPane().getWidth()) / 2)).intValue();
      int intheight =
          new Double(((screenSize.getHeight() - getContentPane().getHeight()) / 2)).intValue();
      setLocation(intwidth, intheight);
    } else {
      setLocation(0, 0);
    }

    menucreate = TLKFactory.getCreateMenu();
    menucreate.BlockWindow(true);
    TLKFAC = menucreate.getTLKFactory();
    RESFAC = menucreate.getResourceFactory();
    String imagestring = "";
    DescriptionText.setText(TLKFAC.getEntry(485));
    try {
      racialmap = RESFAC.getResourceAs2DA("racialtypes");
    } catch (IOException err) {
      JOptionPane.showMessageDialog(
          null,
          "Fatal Error - racialtypes.2da not found. Your data files might be corrupt.",
          "Error",
          0);
      System.exit(0);
    }
    for (int i = 0; i < racialmap.length; i++) {
      String tempispc = racialmap[i][racialtypes.PlayerRace];
      if (tempispc != null && tempispc.equalsIgnoreCase("1")) {
        RaceButton racebutton = new RaceButton();
        descstr = racialmap[i][racialtypes.Name];
        int descnum = ChkHex.ChkHex(descstr);
        racebutton.RaceButton.setText(TLKFAC.getEntry(descnum));
        racebutton.setSize(240, 52);
        racebutton.InfoNum.setText(Integer.toString(i));
        RaceButtonList.add(racebutton, -1);
      }
    }

    pack();
  }
Пример #7
0
  /** Creates new form PortraitMenu1 */
  public PortraitMenu() {
    menucreate = TLKFactory.getCreateMenu();
    TLKFAC = menucreate.getTLKFactory();
    RESFAC = menucreate.getResourceFactory();
    Preferences prefs = Preferences.userRoot().node("/CharacterCreator");
    String NWNDir = prefs.get("GameDir", null);
    FileDelim = prefs.get("FileDelim", null);
    directory = NWNDir + "portraits" + FileDelim;
    menucreate.BlockWindow(true);
    initComponents();
    PortraitScrollPane.setViewportView(PortraitsWindow);
    OKButton.setEnabled(false);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    if ((screenSize.getWidth() > getContentPane().getWidth())
        && (screenSize.getHeight() > getContentPane().getHeight())) {
      int intwidth =
          new Double(((screenSize.getWidth() - getContentPane().getWidth()) / 2)).intValue();
      int intheight =
          new Double(((screenSize.getHeight() - getContentPane().getHeight()) / 2)).intValue();
      setLocation(intwidth, intheight);
    } else setLocation(0, 0);

    try {
      portraitmap = RESFAC.getResourceAs2DA("portraits");
    } catch (IOException err) {
      JOptionPane.showMessageDialog(
          null,
          "Fatal Error - portraits.2da not found. Your data files might be corrupt.",
          "Error",
          0);
      System.exit(0);
    }

    CURRENTPORTRAIT = "resource/portrait.jpg";
    java.net.URL targurl = getClass().getResource(CURRENTPORTRAIT);
    CurrentPortrait.setIcon(new ImageIcon(targurl));
    menucreate = TLKFactory.getCreateMenu();
    sexlock = true;
    racelock = true;

    RedoPortraits(-1);

    pack();
  }
Пример #8
0
  public void keyPressPasswordField(Event ev) {

    String tmp = "";
    char ch = (char) ev.key;
    if ((EXCLAMATION <= ev.key) && (ev.key <= TILDE)) {
      password += ch;
      passwordField.setText(passwordField.getText() + "*");
    }
    if (ev.key == BACKSPACE) {
      if (password.length() > 0) {
        tmp += password.substring(0, password.length() - 1);
        password = tmp;
        tmp = "";
        for (int index = 0; index < password.length(); index++) tmp += "*";
        passwordField.setText(tmp);
        tmp = "";
      }
    }
    if ((ev.key == TAB) || (ev.key == NEWLINE)) {
      if (ev.shiftDown()) nameField.requestFocus();
      else OKButton.requestFocus();
    }
  } // keyPressPasswordField
Пример #9
0
  /**
   * 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.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    imageInfoLabel = new javax.swing.JLabel();
    imgNameLabel = new javax.swing.JLabel();
    imgTypeLabel = new javax.swing.JLabel();
    imgSectorSizeLabel = new javax.swing.JLabel();
    imgNameValue = new javax.swing.JLabel();
    imgTypeValue = new javax.swing.JLabel();
    imgSectorSizeValue = new javax.swing.JLabel();
    OKButton = new javax.swing.JButton();
    imgTotalSizeLabel = new javax.swing.JLabel();
    imgTotalSizeValue = new javax.swing.JLabel();
    imgHashLabel = new javax.swing.JLabel();
    imgHashValue = new javax.swing.JLabel();

    imageInfoLabel.setFont(imageInfoLabel.getFont().deriveFont(Font.BOLD, 18));
    imageInfoLabel.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imageInfoLabel.text")); // NOI18N

    imgNameLabel.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgNameLabel.text")); // NOI18N

    imgTypeLabel.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgTypeLabel.text")); // NOI18N

    imgSectorSizeLabel.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgSectorSizeLabel.text")); // NOI18N

    imgNameValue.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgNameValue.text")); // NOI18N

    imgTypeValue.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgTypeValue.text")); // NOI18N

    imgSectorSizeValue.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgSectorSizeValue.text")); // NOI18N

    OKButton.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.OKButton.text")); // NOI18N

    imgTotalSizeLabel.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgTotalSizeLabel.text")); // NOI18N

    imgTotalSizeValue.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgTotalSizeValue.text")); // NOI18N

    imgHashLabel.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgHashLabel.text")); // NOI18N

    imgHashValue.setText(
        org.openide.util.NbBundle.getMessage(
            ImageDetailsPanel.class, "ImageDetailsPanel.imgHashValue.text")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(0, 68, Short.MAX_VALUE)
                    .addComponent(imageInfoLabel)
                    .addContainerGap(78, Short.MAX_VALUE))
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(imgNameLabel)
                            .addComponent(imgTypeLabel)
                            .addComponent(imgSectorSizeLabel)
                            .addComponent(imgTotalSizeLabel)
                            .addComponent(imgHashLabel))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(imgNameValue)
                            .addComponent(imgTypeValue)
                            .addComponent(imgSectorSizeValue)
                            .addComponent(imgTotalSizeValue)
                            .addComponent(imgHashValue))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(
                        OKButton,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        80,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(38, 38, 38)
                    .addComponent(imageInfoLabel)
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(imgNameValue)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(imgTypeValue)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(imgSectorSizeValue)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(imgTotalSizeValue)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(imgHashValue))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(imgNameLabel)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .UNRELATED)
                                                    .addComponent(imgTypeLabel)
                                                    .addGap(25, 25, 25))
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGap(50, 50, 50)
                                                    .addComponent(imgSectorSizeLabel)))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(imgTotalSizeLabel)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(imgHashLabel)))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 64, Short.MAX_VALUE)
                    .addComponent(OKButton)
                    .addContainerGap()));
  } // </editor-fold>//GEN-END:initComponents
Пример #10
0
  /**
   * 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
Пример #11
0
  /**
   * 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;

    RaceButtonContainer = new javax.swing.JScrollPane();
    RaceButtonBak = new javax.swing.JPanel();
    RaceButtonList = new javax.swing.JPanel();
    RecommendedButton = new javax.swing.JButton();
    OKButton = new javax.swing.JButton();
    CancelButton = new javax.swing.JButton();
    DescriptionContainer = new javax.swing.JScrollPane();
    DescriptionText = new javax.swing.JTextArea();
    PadPanel = new javax.swing.JPanel();
    PadPanel2 = new javax.swing.JPanel();
    PadPanel3 = new javax.swing.JPanel();
    PadPanel4 = new javax.swing.JPanel();
    jPanel16 = new javax.swing.JPanel();
    jPanel17 = new javax.swing.JPanel();

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

    setTitle("Choose a Race for your character.");
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            exitForm(evt);
          }
        });

    RaceButtonContainer.setHorizontalScrollBarPolicy(
        javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    RaceButtonContainer.setVerticalScrollBarPolicy(
        javax.swing.JScrollPane
            .VERTICAL_SCROLLBAR_ALWAYS); // was that weird green color on the menus
    RaceButtonContainer.setViewportBorder(
        new javax.swing.border.MatteBorder(
            new java.awt.Insets(10, 10, 10, 10), new java.awt.Color(0, 0, 0)));
    RaceButtonContainer.setMaximumSize(new java.awt.Dimension(32767, 300));
    RaceButtonContainer.setPreferredSize(new java.awt.Dimension(283, 300));
    RaceButtonContainer.setAutoscrolls(true);
    RaceButtonContainer.getVerticalScrollBar().setUnitIncrement(52);
    RaceButtonContainer.getVerticalScrollBar().setBlockIncrement(52);

    RaceButtonBak.setLayout(new java.awt.GridBagLayout());
    RaceButtonBak.setBackground(new java.awt.Color(0, 0, 0));
    RaceButtonBak.setForeground(new java.awt.Color(255, 255, 255)); // color not seen
    RaceButtonBak.setAlignmentX(0.0F);
    RaceButtonBak.setAlignmentY(0.0F);
    RaceButtonBak.setAutoscrolls(true);

    RaceButtonList.setLayout(new java.awt.GridLayout(0, 1));
    RaceButtonList.setBackground(new java.awt.Color(0, 0, 0)); // outline behind buttons
    RaceButtonList.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(3, 3, 3, 3)));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    RaceButtonBak.add(RaceButtonList, gridBagConstraints);

    RaceButtonContainer.setViewportView(RaceButtonBak);

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

    RecommendedButton.setText("Recommended");
    RecommendedButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            RecommendedButtonActionPerformed(evt);
          }
        });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 8;
    getContentPane().add(RecommendedButton, 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 = 3;
    gridBagConstraints.gridy = 8;
    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 = 4;
    gridBagConstraints.gridy = 8;
    getContentPane().add(CancelButton, gridBagConstraints);

    DescriptionContainer.setHorizontalScrollBarPolicy(
        javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    DescriptionContainer.setVerticalScrollBarPolicy(
        javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // behind text description
    DescriptionContainer.setViewportBorder(
        new javax.swing.border.MatteBorder(
            new java.awt.Insets(10, 10, 10, 10), new java.awt.Color(0, 0, 0)));
    DescriptionContainer.setPreferredSize(new java.awt.Dimension(400, 300));
    DescriptionText.setBackground(new java.awt.Color(0, 0, 0));
    DescriptionText.setForeground(new java.awt.Color(240, 216, 130)); // text for description
    DescriptionText.setLineWrap(true);
    DescriptionText.setWrapStyleWord(true);
    DescriptionText.setPreferredSize(new java.awt.Dimension(400, 800));
    DescriptionText.setAutoscrolls(false);
    DescriptionContainer.setViewportView(DescriptionText);

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

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(PadPanel, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(PadPanel2, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(PadPanel3, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(PadPanel4, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(jPanel16, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(jPanel17, gridBagConstraints);

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