/*
#	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);
        setTitle(" À Propos");

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

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

        basLabel.setFont(new java.awt.Font("Arial", 2, 14));
        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);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(34, 34, 34)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER)
                    .add(hautLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .add(centreLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .add(basLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .add(okBtn))
                .add(47, 47, 47))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(23, 23, 23)
                .add(hautLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(centreLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(7, 7, 7)
                .add(basLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(okBtn)
                .addContainerGap(28, 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

    /**
    * @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

}
