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

// Le fichier Message.java se trouve dans le répertoire 
// Sources/Projet/Chapitre12/NetBeansProjects/ProjetChapitre12/src/Projet
package Projet;

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

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

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

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

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

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

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

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(hautLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .addComponent(centreLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .addComponent(basLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .addComponent(okBtn))
                .addGap(47, 47, 47))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .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)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(okBtn)
                .addContainerGap(20, Short.MAX_VALUE))
        );

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

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

  

    // 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
}
