Compare commits

...

2 Commits

Author SHA1 Message Date
1515f943c8 Merge pull request 'EMILE pascuit' (#21) from Java.medhi2 into main
Reviewed-on: #21
2025-03-13 11:55:37 +01:00
medhi.rodrigues
c8a8aac214 EMILE pascuit 2025-03-13 11:54:26 +01:00
3 changed files with 103 additions and 97 deletions

View File

@ -102,7 +102,7 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
String compositionTrouve = rechercheMedoc.get(2); String compositionTrouve = rechercheMedoc.get(2);
String effetTrouve = rechercheMedoc.get(3); String effetTrouve = rechercheMedoc.get(3);
String contreIndicationTrouve = rechercheMedoc.get(4); String contreIndicationTrouve = rechercheMedoc.get(4);
String imgTrouve = "/img/"+ idTrouve +".jpg"; String imgTrouve = idTrouve;
Medicament medocTrouve = new Medicament(idTrouve, nomTrouve , compositionTrouve, effetTrouve, contreIndicationTrouve,imgTrouve); Medicament medocTrouve = new Medicament(idTrouve, nomTrouve , compositionTrouve, effetTrouve, contreIndicationTrouve,imgTrouve);
new jffInfoMedoc(medocTrouve).setVisible(true); new jffInfoMedoc(medocTrouve).setVisible(true);

View File

@ -49,32 +49,42 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jSeparator1" alignment="1" max="32767" attributes="0"/> <Component id="jSeparator1" alignment="1" max="32767" attributes="0"/>
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="jLContrindication" min="-2" pref="265" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0">
<Component id="jLPrix" min="-2" pref="100" max="-2" attributes="0"/> <Group type="102" alignment="1" attributes="0">
<Component id="jLContrindication" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLEffet" min="-2" pref="166" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLComposition" min="-2" pref="265" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="140" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="183" max="-2" attributes="0"/>
<Component id="jLNomCo" min="-2" pref="144" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLImage" min="-2" pref="157" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="38" max="-2" attributes="0"/>
</Group>
</Group>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0"> <EmptySpace min="-2" pref="168" max="-2" attributes="0"/>
<Component id="jLComposition" min="-2" pref="265" max="-2" attributes="0"/> <Component id="jLNomMedoc" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" pref="265" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLImage" min="-2" pref="157" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace min="0" pref="26" max="32767" attributes="0"/> <EmptySpace min="0" pref="163" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="168" max="-2" attributes="0"/>
<Component id="jLNomMedoc" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
@ -82,29 +92,31 @@
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jLNomMedoc" min="-2" max="-2" attributes="0"/> <Component id="jLNomMedoc" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" pref="86" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLComposition" min="-2" pref="74" max="-2" attributes="0"/>
</Group>
<Component id="jLImage" max="32767" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<EmptySpace type="unrelated" pref="18" max="32767" attributes="0"/> <Component id="jLNomCo" min="-2" pref="37" max="-2" attributes="0"/>
<Component id="jLContrindication" min="-2" pref="70" max="-2" attributes="0"/> <EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
<EmptySpace pref="23" max="32767" attributes="0"/> <Component id="jLComposition" min="-2" pref="74" max="-2" attributes="0"/>
<EmptySpace pref="60" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLContrindication" min="-2" pref="141" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="169" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLEffet" min="-2" pref="131" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" attributes="0">
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/> <Component id="jLImage" min="-2" pref="172" max="-2" attributes="0"/>
<Component id="jLPrix" min="-2" pref="26" max="-2" attributes="0"/> <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
<Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="169" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -115,35 +127,20 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI Black" size="18" style="0"/> <Font name="Segoe UI Black" size="18" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" value="Nom du M&#xe9;doc"/> <Property name="text" type="java.lang.String" value="Nom du M&#xe9;dicament :"/>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JLabel" name="jLabel1"> <Component class="javax.swing.JLabel" name="jLNomCo">
<Properties>
<Property name="text" type="java.lang.String" value="Les effets du m&#xe9;dicament"/>
</Properties>
</Component> </Component>
<Component class="javax.swing.JLabel" name="jLComposition"> <Component class="javax.swing.JLabel" name="jLComposition">
<Properties>
<Property name="text" type="java.lang.String" value="Composition du m&#xe9;doc"/>
</Properties>
</Component> </Component>
<Component class="javax.swing.JLabel" name="jLContrindication"> <Component class="javax.swing.JLabel" name="jLContrindication">
<Properties>
<Property name="text" type="java.lang.String" value="Contrindications du m&#xe9;doc"/>
</Properties>
</Component> </Component>
<Component class="javax.swing.JLabel" name="jLImage"> <Component class="javax.swing.JLabel" name="jLImage">
<Properties>
<Property name="text" type="java.lang.String" value="Image"/>
</Properties>
</Component> </Component>
<Component class="javax.swing.JSeparator" name="jSeparator1"> <Component class="javax.swing.JSeparator" name="jSeparator1">
</Component> </Component>
<Component class="javax.swing.JLabel" name="jLPrix"> <Component class="javax.swing.JLabel" name="jLEffet">
<Properties>
<Property name="text" type="java.lang.String" value="Prix :"/>
</Properties>
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>

View File

@ -5,6 +5,10 @@
package presentation; package presentation;
import Metier.Medicament; 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) { public jffInfoMedoc(Medicament medocTrouve) {
initComponents(); 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(); jPFond = new javax.swing.JPanel();
jLNomMedoc = new javax.swing.JLabel(); jLNomMedoc = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel(); jLNomCo = new javax.swing.JLabel();
jLComposition = new javax.swing.JLabel(); jLComposition = new javax.swing.JLabel();
jLContrindication = new javax.swing.JLabel(); jLContrindication = new javax.swing.JLabel();
jLImage = new javax.swing.JLabel(); jLImage = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator(); jSeparator1 = new javax.swing.JSeparator();
jLPrix = new javax.swing.JLabel(); jLEffet = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLNomMedoc.setFont(new java.awt.Font("Segoe UI Black", 0, 18)); // NOI18N jLNomMedoc.setFont(new java.awt.Font("Segoe UI Black", 0, 18)); // NOI18N
jLNomMedoc.setText("Nom du Médoc"); jLNomMedoc.setText("Nom du Médicament :");
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 :");
javax.swing.GroupLayout jPFondLayout = new javax.swing.GroupLayout(jPFond); javax.swing.GroupLayout jPFondLayout = new javax.swing.GroupLayout(jPFond);
jPFond.setLayout(jPFondLayout); jPFond.setLayout(jPFondLayout);
@ -63,46 +66,52 @@ public class jffInfoMedoc extends javax.swing.JFrame {
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup() .addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGap(18, 18, 18) .addGroup(jPFondLayout.createSequentialGroup()
.addComponent(jLPrix, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .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() .addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap() .addGap(168, 168, 168)
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLNomMedoc)))
.addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 163, Short.MAX_VALUE)))
.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)))
.addContainerGap()) .addContainerGap())
.addGroup(jPFondLayout.createSequentialGroup()
.addGap(168, 168, 168)
.addComponent(jLNomMedoc)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
jPFondLayout.setVerticalGroup( jPFondLayout.setVerticalGroup(
jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup() .addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(jLNomMedoc) .addComponent(jLNomMedoc)
.addGap(39, 39, 39) .addGap(18, 18, 18)
.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))
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup() .addGroup(jPFondLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 18, Short.MAX_VALUE) .addComponent(jLNomCo, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(28, 28, 28)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)) .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() .addGroup(jPFondLayout.createSequentialGroup()
.addGap(35, 35, 35) .addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLPrix, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))))
.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))
); );
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 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 // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLComposition; private javax.swing.JLabel jLComposition;
private javax.swing.JLabel jLContrindication; private javax.swing.JLabel jLContrindication;
private javax.swing.JLabel jLEffet;
private javax.swing.JLabel jLImage; private javax.swing.JLabel jLImage;
private javax.swing.JLabel jLNomCo;
private javax.swing.JLabel jLNomMedoc; private javax.swing.JLabel jLNomMedoc;
private javax.swing.JLabel jLPrix;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPFond; private javax.swing.JPanel jPFond;
private javax.swing.JSeparator jSeparator1; private javax.swing.JSeparator jSeparator1;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables