/*
#	Le livre de Java 1er langage
#	A. Tasso
#	Chapitre 12 : Créer une interface graphique
#	Section  : Exercice 12.4 à 12.7
#	Fichier  : Message.java
#	Class    : Message
*/

// Le fichier Message.java se trouve dans le répertoire 
// Sources/Exercices/Chapitre12/NetBeansProjects/GestionClasseExercice/src/Introduction
package Introduction;

public class Message extends javax.swing.JFrame {
    // 12.7.c Le constructeur de la classe Message
    public Message(String hmsg, String cmsg, String bmsg) {
          this.setVisible(true);
        initComponents();
        this.setBounds(300, 300, 222, 322);
        // 12.7.c Affiche le contenu du premier paramètre dans le composant hautLabel
        hautLabel.setText(hmsg);
        // 12.7.c Affiche le contenu du second paramètre dans le composant centreLabel
        centreLabel.setText(cmsg);
        // 12.7.c Affiche le contenu du troisième paramètre dans le composant basLabel
        basLabel.setText(bmsg);
    }

    /** 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() {

        okBtn = new javax.swing.JButton();
        centreLabel = new javax.swing.JLabel();
        basLabel = new javax.swing.JLabel();
        hautLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Message");

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

        centreLabel.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        centreLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        centreLabel.setText("Message");

        basLabel.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
        basLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        basLabel.setText("Message");

        hautLabel.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
        hautLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hautLabel.setText("Message");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(hautLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
                    .addComponent(centreLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
                    .addComponent(basLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
                    .addComponent(okBtn))
                .addGap(39, 39, 39))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(47, Short.MAX_VALUE)
                .addComponent(hautLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(centreLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(7, 7, 7)
                .addComponent(basLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(okBtn)
                .addGap(36, 36, 36))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void okBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okBtnActionPerformed
    // 12.7.d Fermer la fenêtre sans quitter l'application
    this.dispose();
}//GEN-LAST:event_okBtnActionPerformed

    /**
    * @param args the command line arguments
    */
 

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel basLabel;
    private javax.swing.JLabel centreLabel;
    private javax.swing.JLabel hautLabel;
    private javax.swing.JButton okBtn;
    // End of variables declaration//GEN-END:variables

}
