package IHM; import javax.swing.*; import java.awt.*; import IHM.Totalcaisse.*; import IHM.ListenerTexte.*; import IHM.SpecialTextField.*; public class Principale extends javax.swing.JFrame { public Principale(Totalcaisse totalcaisse) { super("Principale"); getContentPane().setLayout(new FlowLayout()); SaisiNomAnimateur = new SpecialJTextField(this, totalcaisse); btnTotalCaisse.addActionListener(new ListenerBouton(this)); getContentPane().add(SaisiNomAnimateur); getContentPane().add(btnTotalCaisse); pack(); setVisible(true); initComponents(); } public JTextField getSaisiNomAnimateur() { return SaisiNomAnimateur; } @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { btnTotalCaisse = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jMonthChooser1 = new com.toedter.calendar.JMonthChooser(); jSpinField1 = new com.toedter.components.JSpinField(); jLabel1 = new javax.swing.JLabel(); SaisiNomAnimateur = new javax.swing.JTextField(); btnTarifAvecCarte = new javax.swing.JButton(); jSpinField2 = new com.toedter.components.JSpinField(); jYearChooser1 = new com.toedter.calendar.JYearChooser(); btnQuitter = new javax.swing.JButton(); btnTraifSansCarte = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); btnTotalCaisse.setText("Total Caisse"); btnTotalCaisse.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnTotalCaisseActionPerformed(evt); } }); jLabel2.setText("Solde Caisse"); jLabel3.setIcon(new javax.swing.ImageIcon("C:\\Users\\momo\\Desktop\\images maj.jpg")); // NOI18N jLabel1.setText("Nom Animateur"); SaisiNomAnimateur.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SaisiNomAnimateurActionPerformed(evt); } }); btnTarifAvecCarte.setText("Tarif Avec Carte"); btnTarifAvecCarte.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnTarifAvecCarteActionPerformed(evt); } }); btnQuitter.setText("Quitter"); btnQuitter.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btnQuitterMouseClicked(evt); } }); btnQuitter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnQuitterActionPerformed(evt); } }); btnTraifSansCarte.setText("Tarif Sans Carte"); btnTraifSansCarte.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnTraifSansCarteActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 578, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jSpinField1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jMonthChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE) .addGap(6, 6, 6)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(btnTarifAvecCarte, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jSpinField2, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jYearChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(51, 51, 51) .addComponent(btnTotalCaisse))) .addGap(24, 24, 24) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addGap(18, 18, 18) .addComponent(SaisiNomAnimateur, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(btnTraifSansCarte, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addGap(89, 89, 89) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnQuitter, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(33, 33, 33))) .addGap(30, 30, 30)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 300, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(41, 41, 41) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(SaisiNomAnimateur)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 3, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jMonthChooser1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE) .addComponent(jSpinField1, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE) .addComponent(jYearChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE)) .addGap(110, 110, 110))) .addGap(69, 69, 69)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnTarifAvecCarte, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnTotalCaisse, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnTraifSansCarte, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(54, 54, 54))) .addGap(3, 3, 3) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE) .addComponent(jSpinField2, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)) .addGap(8, 8, 8)) .addComponent(btnQuitter))) .addGroup(layout.createSequentialGroup() .addContainerGap(232, Short.MAX_VALUE) .addComponent(jLabel3))) .addGap(22, 22, 22)) ); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-594)/2, (screenSize.height-338)/2, 594, 338); }// //GEN-END:initComponents private void btnTotalCaisseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTotalCaisseActionPerformed Totalcaisse totalcaisse = new Totalcaisse(this, true);// appelle la fenêtre I_totalcaisse totalcaisse.setVisible(true); // Rendre Visible la fenêtre I_totalcaisse }//GEN-LAST:event_btnTotalCaisseActionPerformed private void SaisiNomAnimateurActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaisiNomAnimateurActionPerformed // String texte = SaisiNomAnimateur.getText(); // lblNomAnimateur.setText (texte); }//GEN-LAST:event_SaisiNomAnimateurActionPerformed private void btnTarifAvecCarteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTarifAvecCarteActionPerformed I_tarifaveccarte i_tarifaveccarte = new I_tarifaveccarte(this, true); // appelle la fenêtre I_tarifaveccarte i_tarifaveccarte.setVisible(true); //Rendre Visible la fenêtre I_tarifaveccarte }//GEN-LAST:event_btnTarifAvecCarteActionPerformed private void btnQuitterMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnQuitterMouseClicked System.exit(0); // le Bouton Quitter permet de sortir de l'application }//GEN-LAST:event_btnQuitterMouseClicked private void btnQuitterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitterActionPerformed }//GEN-LAST:event_btnQuitterActionPerformed private void btnTraifSansCarteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTraifSansCarteActionPerformed I_tarifsanscarte i_tarifsanscarte = new I_tarifsanscarte(this, true); // appelle la fenêtre I_tarifsanscarte i_tarifsanscarte.setVisible(true); // Rendre Visible la fenêtre I_tarifsanscarte }//GEN-LAST:event_btnTraifSansCarteActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { //new Principale().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField SaisiNomAnimateur; private javax.swing.JButton btnQuitter; private javax.swing.JButton btnTarifAvecCarte; private javax.swing.JButton btnTotalCaisse; private javax.swing.JButton btnTraifSansCarte; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private com.toedter.calendar.JMonthChooser jMonthChooser1; private com.toedter.components.JSpinField jSpinField1; private com.toedter.components.JSpinField jSpinField2; private com.toedter.calendar.JYearChooser jYearChooser1; // End of variables declaration//GEN-END:variables }