diff --git a/GSBapplication/src/presentation/jffFamilleMedoc.java b/GSBapplication/src/presentation/jffFamilleMedoc.java
index 6639e20..97247d4 100644
--- a/GSBapplication/src/presentation/jffFamilleMedoc.java
+++ b/GSBapplication/src/presentation/jffFamilleMedoc.java
@@ -102,7 +102,7 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
String compositionTrouve = rechercheMedoc.get(2);
String effetTrouve = rechercheMedoc.get(3);
String contreIndicationTrouve = rechercheMedoc.get(4);
- String imgTrouve = "/img/"+ idTrouve +".jpg";
+ String imgTrouve = idTrouve;
Medicament medocTrouve = new Medicament(idTrouve, nomTrouve , compositionTrouve, effetTrouve, contreIndicationTrouve,imgTrouve);
new jffInfoMedoc(medocTrouve).setVisible(true);
diff --git a/GSBapplication/src/presentation/jffInfoMedoc.form b/GSBapplication/src/presentation/jffInfoMedoc.form
index a72bf53..6abf3b6 100644
--- a/GSBapplication/src/presentation/jffInfoMedoc.form
+++ b/GSBapplication/src/presentation/jffInfoMedoc.form
@@ -49,32 +49,42 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
@@ -82,29 +92,31 @@
-
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
@@ -115,35 +127,20 @@
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/GSBapplication/src/presentation/jffInfoMedoc.java b/GSBapplication/src/presentation/jffInfoMedoc.java
index d05668a..1196659 100644
--- a/GSBapplication/src/presentation/jffInfoMedoc.java
+++ b/GSBapplication/src/presentation/jffInfoMedoc.java
@@ -5,6 +5,10 @@
package presentation;
import Metier.Medicament;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
/**
*
@@ -17,6 +21,15 @@ public class jffInfoMedoc extends javax.swing.JFrame {
*/
public jffInfoMedoc(Medicament medocTrouve) {
initComponents();
+ jLNomCo.setText(medocTrouve.getNom());
+ //Icon imgMedoc = new javax.swing.ImageIcon(getClass().getResource("/img/" + medocTrouve.getImg() + ".jpg"));
+ //jLImage.setIcon(imgMedoc);
+ BufferedImage imgResize = null;
+ jLImage.setIcon(new ImageIcon(new javax.swing.ImageIcon(getClass().getResource("/img/" + medocTrouve.getImg() + ".jpg")).getImage().getScaledInstance(200, 50, Image.SCALE_SMOOTH)));
+ jLComposition.setText(medocTrouve.getComposition());
+ jLContrindication.setText(medocTrouve.getContreindication());
+ jLEffet.setText(medocTrouve.getEffet());
+
}
/**
@@ -30,27 +43,17 @@ public class jffInfoMedoc extends javax.swing.JFrame {
jPFond = new javax.swing.JPanel();
jLNomMedoc = new javax.swing.JLabel();
- jLabel1 = new javax.swing.JLabel();
+ jLNomCo = new javax.swing.JLabel();
jLComposition = new javax.swing.JLabel();
jLContrindication = new javax.swing.JLabel();
jLImage = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
- jLPrix = new javax.swing.JLabel();
+ jLEffet = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLNomMedoc.setFont(new java.awt.Font("Segoe UI Black", 0, 18)); // NOI18N
- jLNomMedoc.setText("Nom du Médoc");
-
- jLabel1.setText("Les effets du médicament");
-
- jLComposition.setText("Composition du médoc");
-
- jLContrindication.setText("Contrindications du médoc");
-
- jLImage.setText("Image");
-
- jLPrix.setText("Prix :");
+ jLNomMedoc.setText("Nom du Médicament :");
javax.swing.GroupLayout jPFondLayout = new javax.swing.GroupLayout(jPFond);
jPFond.setLayout(jPFondLayout);
@@ -63,46 +66,52 @@ public class jffInfoMedoc extends javax.swing.JFrame {
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap()
- .addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addComponent(jLPrix, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addGroup(jPFondLayout.createSequentialGroup()
+ .addComponent(jLContrindication, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLEffet, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(jPFondLayout.createSequentialGroup()
+ .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPFondLayout.createSequentialGroup()
+ .addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(140, 140, 140))
+ .addGroup(jPFondLayout.createSequentialGroup()
+ .addGap(183, 183, 183)
+ .addComponent(jLNomCo, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(78, 78, 78)))
+ .addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(38, 38, 38))))
.addGroup(jPFondLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGap(0, 26, Short.MAX_VALUE)))
+ .addGap(168, 168, 168)
+ .addComponent(jLNomMedoc)))
+ .addGap(0, 163, Short.MAX_VALUE)))
.addContainerGap())
- .addGroup(jPFondLayout.createSequentialGroup()
- .addGap(168, 168, 168)
- .addComponent(jLNomMedoc)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPFondLayout.setVerticalGroup(
jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLNomMedoc)
- .addGap(39, 39, 39)
- .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addGroup(jPFondLayout.createSequentialGroup()
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(jLImage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGap(18, 18, 18)
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 18, Short.MAX_VALUE)
- .addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE))
+ .addComponent(jLNomCo, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(28, 28, 28)
+ .addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
+ .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPFondLayout.createSequentialGroup()
+ .addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(169, 169, 169))
+ .addGroup(jPFondLayout.createSequentialGroup()
+ .addComponent(jLEffet, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(jPFondLayout.createSequentialGroup()
- .addGap(35, 35, 35)
- .addComponent(jLPrix, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
- .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(169, 169, 169))
+ .addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(0, 0, Short.MAX_VALUE))))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
@@ -161,10 +170,10 @@ public class jffInfoMedoc extends javax.swing.JFrame {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLComposition;
private javax.swing.JLabel jLContrindication;
+ private javax.swing.JLabel jLEffet;
private javax.swing.JLabel jLImage;
+ private javax.swing.JLabel jLNomCo;
private javax.swing.JLabel jLNomMedoc;
- private javax.swing.JLabel jLPrix;
- private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPFond;
private javax.swing.JSeparator jSeparator1;
// End of variables declaration//GEN-END:variables