diff --git a/JDR/src/interfaces/jFFJDR.form b/JDR/src/interfaces/jFFJDR.form index 93892ae..fbba90a 100644 --- a/JDR/src/interfaces/jFFJDR.form +++ b/JDR/src/interfaces/jFFJDR.form @@ -1,10 +1,120 @@
diff --git a/JDR/src/interfaces/jFFJDR.java b/JDR/src/interfaces/jFFJDR.java index 1dd858b..f219c3d 100644 --- a/JDR/src/interfaces/jFFJDR.java +++ b/JDR/src/interfaces/jFFJDR.java @@ -6,6 +6,7 @@ package interfaces; import java.util.*; import javax.swing.*; +import static javax.swing.JOptionPane.*; import metier.*; /** @@ -13,14 +14,17 @@ import metier.*; * @author steve.maingana */ public class jFFJDR extends javax.swing.JFrame { - public Jeu jdr = new Jeu("JDR"); + public String nomJeu = "JDR: LOL"; + public Jeu jdr = new Jeu(nomJeu); + public Personnage p1; + public Personnage p2; + /** * Creates new form jFFJDR */ public jFFJDR() { initComponents(); actualiserInformations(); - } @@ -57,22 +61,51 @@ public class jFFJDR extends javax.swing.JFrame { jPanel2 = new javax.swing.JPanel(); jCBPerso1 = new javax.swing.JComboBox<>(); jPanel3 = new javax.swing.JPanel(); + jScrollPane3 = new javax.swing.JScrollPane(); + jTAPerso2 = new javax.swing.JTextArea(); + jLIconPerso2 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); + jScrollPane2 = new javax.swing.JScrollPane(); + jTAPerso1 = new javax.swing.JTextArea(); + jLIconPerso1 = new javax.swing.JLabel(); jCBPerso2 = new javax.swing.JComboBox<>(); jPInfos = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTAInfos = new javax.swing.JTextArea(); jBtGo = new javax.swing.JButton(); + jMenuBar1 = new javax.swing.JMenuBar(); + jMItemRecommencer = new javax.swing.JMenu(); + jMenuItem1 = new javax.swing.JMenuItem(); + jMenu1 = new javax.swing.JMenu(); + jMenuItem2 = new javax.swing.JMenuItem(); + jMenuItem5 = new javax.swing.JMenuItem(); + jMenuItem9 = new javax.swing.JMenuItem(); + jMItemNouveauPerso = new javax.swing.JMenuItem(); + jMenuItem3 = new javax.swing.JMenuItem(); + jMenuItem4 = new javax.swing.JMenuItem(); + jMItemQuitter = new javax.swing.JMenuItem(); + jMenu2 = new javax.swing.JMenu(); + jMenuItem6 = new javax.swing.JMenuItem(); + jMenuItem7 = new javax.swing.JMenuItem(); + jMenuItem8 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jPChoix.setBackground(new java.awt.Color(255, 255, 255)); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/famille_1.jpg"))); // NOI18N - jLabel3.setFont(new java.awt.Font("Snap ITC", 0, 12)); // NOI18N - jLabel3.setText("Choix du personnage"); + jPanel1.setBackground(new java.awt.Color(204, 204, 204)); + jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jLabel3.setFont(new java.awt.Font("Snap ITC", 0, 18)); // NOI18N + jLabel3.setForeground(new java.awt.Color(102, 0, 0)); + jLabel3.setText("Choix du personnages"); + jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 220, 30)); + + jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jCBPerso1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -81,30 +114,32 @@ public class jFFJDR extends javax.swing.JFrame { }); jPanel3.setBackground(new java.awt.Color(153, 0, 0)); + jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); - jPanel3.setLayout(jPanel3Layout); - jPanel3Layout.setHorizontalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 163, Short.MAX_VALUE) - ); - jPanel3Layout.setVerticalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 0, Short.MAX_VALUE) - ); + jTAPerso2.setBackground(new java.awt.Color(153, 0, 0)); + jTAPerso2.setColumns(20); + jTAPerso2.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N + jTAPerso2.setForeground(new java.awt.Color(255, 255, 255)); + jTAPerso2.setRows(5); + jTAPerso2.setFocusable(false); + jScrollPane3.setViewportView(jTAPerso2); + + jPanel3.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 250, 141)); + jPanel3.add(jLIconPerso2, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 140, -1, -1)); jPanel4.setBackground(new java.awt.Color(153, 0, 0)); + jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); - jPanel4.setLayout(jPanel4Layout); - jPanel4Layout.setHorizontalGroup( - jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 163, Short.MAX_VALUE) - ); - jPanel4Layout.setVerticalGroup( - jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 172, Short.MAX_VALUE) - ); + jTAPerso1.setBackground(new java.awt.Color(153, 0, 0)); + jTAPerso1.setColumns(20); + jTAPerso1.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N + jTAPerso1.setForeground(new java.awt.Color(255, 255, 255)); + jTAPerso1.setRows(5); + jTAPerso1.setFocusable(false); + jScrollPane2.setViewportView(jTAPerso1); + + jPanel4.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 250, 140)); + jPanel4.add(jLIconPerso1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 140, -1, -1)); jCBPerso2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -117,17 +152,22 @@ public class jFFJDR extends javax.swing.JFrame { jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(47, 47, 47) - .addComponent(jCBPerso1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 113, Short.MAX_VALUE) - .addComponent(jCBPerso2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(44, 44, 44)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(6, 6, 6) - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(73, 73, 73) + .addComponent(jCBPerso1, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jCBPerso2, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(63, 63, 63)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()))) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -138,36 +178,24 @@ public class jFFJDR extends javax.swing.JFrame { .addGap(6, 6, 6) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)) .addContainerGap()) ); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel3) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel3) - .addGap(13, 13, 13) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); + jPanel1.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 30, 520, 320)); javax.swing.GroupLayout jPChoixLayout = new javax.swing.GroupLayout(jPChoix); jPChoix.setLayout(jPChoixLayout); jPChoixLayout.setHorizontalGroup( jPChoixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPChoixLayout.createSequentialGroup() - .addGap(100, 100, 100) - .addComponent(jLabel1) - .addGap(73, 73, 73)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPChoixLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPChoixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPChoixLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPChoixLayout.createSequentialGroup() + .addGap(161, 161, 161) + .addComponent(jLabel1))) .addContainerGap()) ); jPChoixLayout.setVerticalGroup( @@ -176,9 +204,11 @@ public class jFFJDR extends javax.swing.JFrame { .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(24, Short.MAX_VALUE)) ); + getContentPane().add(jPChoix, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 530, 510)); + jPInfos.setBackground(new java.awt.Color(51, 0, 0)); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/adj_1.jpg"))); // NOI18N @@ -187,7 +217,10 @@ public class jFFJDR extends javax.swing.JFrame { jTAInfos.setEditable(false); jTAInfos.setBackground(new java.awt.Color(51, 0, 0)); jTAInfos.setColumns(20); + jTAInfos.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N + jTAInfos.setForeground(new java.awt.Color(255, 255, 255)); jTAInfos.setRows(5); + jTAInfos.setFocusable(false); jScrollPane1.setViewportView(jTAInfos); javax.swing.GroupLayout jPInfosLayout = new javax.swing.GroupLayout(jPInfos); @@ -196,71 +229,173 @@ public class jFFJDR extends javax.swing.JFrame { jPInfosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPInfosLayout.createSequentialGroup() .addGap(30, 30, 30) - .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPInfosLayout.createSequentialGroup() - .addGap(10, 10, 10) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(30, 30, 30)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPInfosLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) ); jPInfosLayout.setVerticalGroup( jPInfosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPInfosLayout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(jLabel2) - .addGap(10, 10, 10) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 508, Short.MAX_VALUE) + .addContainerGap()) ); + getContentPane().add(jPInfos, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 0, 260, 650)); + jBtGo.setText("GO"); jBtGo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBtGoActionPerformed(evt); } }); + getContentPane().add(jBtGo, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 580, 110, -1)); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(140, 140, 140) - .addComponent(jBtGo)) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPChoix, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPInfos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(114, 114, 114)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(10, 10, 10) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jPChoix, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jBtGo)) - .addComponent(jPInfos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); + jMItemRecommencer.setText("Jeu"); + + jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMenuItem1.setText("Nouvelle partie"); + jMenuItem1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem1ActionPerformed(evt); + } + }); + jMItemRecommencer.add(jMenuItem1); + + jMenu1.setText("Ajouter un personnage"); + + jMenuItem2.setText("Guerrier"); + jMenu1.add(jMenuItem2); + + jMenuItem5.setText("Sorcier"); + jMenu1.add(jMenuItem5); + + jMenuItem9.setText("Voleur"); + jMenu1.add(jMenuItem9); + + jMItemRecommencer.add(jMenu1); + + jMItemNouveauPerso.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PLUS, 0)); + jMItemNouveauPerso.setText("Ajouter des personnages"); + jMItemNouveauPerso.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMItemNouveauPersoActionPerformed(evt); + } + }); + jMItemRecommencer.add(jMItemNouveauPerso); + + jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMenuItem3.setText("Ouvrir une partie"); + jMItemRecommencer.add(jMenuItem3); + + jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMenuItem4.setText("Sauvegarder la partie"); + jMenuItem4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem4ActionPerformed(evt); + } + }); + jMItemRecommencer.add(jMenuItem4); + + jMItemQuitter.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMItemQuitter.setText("Quitter"); + jMItemQuitter.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMItemQuitterActionPerformed(evt); + } + }); + jMItemRecommencer.add(jMItemQuitter); + + jMenuBar1.add(jMItemRecommencer); + + jMenu2.setText("?"); + + jMenuItem6.setText("Aide"); + jMenu2.add(jMenuItem6); + + jMenuItem7.setText("Objectifs"); + jMenu2.add(jMenuItem7); + + jMenuItem8.setText("À propos"); + jMenu2.add(jMenuItem8); + + jMenuBar1.add(jMenu2); + + setJMenuBar(jMenuBar1); pack(); }// //GEN-END:initComponents private void jBtGoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtGoActionPerformed // TODO add your handling code here: + String selectionPerso1 = (String) jCBPerso1.getSelectedItem(); + String selectionPerso2 = (String) jCBPerso2.getSelectedItem(); + String nomPerso1 = selectionPerso1.split(": ")[1]; + String nomPerso2 = selectionPerso2.split(": ")[1]; + p1 = jdr.rechercherPerso(nomPerso1); + p2 = jdr.rechercherPerso(nomPerso2); + + if (p1.equals(p2)) { + String message = "Tu as de sérieux problèmes psychologiques pour avoir besoin de te rencontrer toi-même...\n"; + message += "Tu deviens plus faible et perds un point d'énergie !"; + JOptionPane.showMessageDialog(null, message, "Faiblesses psychologiques", WARNING_MESSAGE); + if (p1.getEnergie() > 0) { + p1.setEnergie(p1.getEnergie()-1); + } + } else { + p1.rencontrer(p2); + } + + actualiserInformations(); }//GEN-LAST:event_jBtGoActionPerformed private void jCBPerso2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBPerso2ActionPerformed // TODO add your handling code here: + String selectionPerso = (String) jCBPerso2.getSelectedItem(); + String nomPerso = selectionPerso.split(": ")[1]; + Personnage perso = jdr.rechercherPerso(nomPerso); + Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + perso.getImg())); + jTAPerso2.setText(perso.resumerPersonnage()); + jLIconPerso2.setIcon(imgPerso); }//GEN-LAST:event_jCBPerso2ActionPerformed private void jCBPerso1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBPerso1ActionPerformed // TODO add your handling code here: + String selectionPerso = (String) jCBPerso1.getSelectedItem(); + String nomPerso = selectionPerso.split(": ")[1]; + Personnage perso = jdr.rechercherPerso(nomPerso); + Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + perso.getImg())); + jTAPerso1.setText(perso.resumerPersonnage()); + jLIconPerso1.setIcon(imgPerso); }//GEN-LAST:event_jCBPerso1ActionPerformed + private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed + // TODO add your handling code here: + this.jdr = new Jeu(nomJeu); + initComponents(); + actualiserInformations(); + }//GEN-LAST:event_jMenuItem1ActionPerformed + + private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jMenuItem4ActionPerformed + + private void jMItemQuitterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMItemQuitterActionPerformed + // TODO add your handling code here: + System.exit(0); + }//GEN-LAST:event_jMItemQuitterActionPerformed + + private void jMItemNouveauPersoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMItemNouveauPersoActionPerformed + // TODO add your handling code here: + jFFNouveauPerso saisiPerso = new jFFNouveauPerso(jdr, jMItemNouveauPerso, true); + saisiPerso.setVisible(true); + }//GEN-LAST:event_jMItemNouveauPersoActionPerformed + /** * @param args the command line arguments */ @@ -300,9 +435,26 @@ public class jFFJDR extends javax.swing.JFrame { private javax.swing.JButton jBtGo; private javax.swing.JComboBox