content: /*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  package havayolubilgisistemi;
  
  import java.awt.Color;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.UIManager;
  import javax.swing.UnsupportedLookAndFeelException;
  
  /**
   *
   * @author AsusTuf
   */
  public class Duzelt extends javax.swing.JFrame {
  
      /**
       * Creates new form Duzelt
       */
      private String adi;
      public Duzelt(User user) {
          initComponents();
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
              e.printStackTrace();
          }
          Color backgroundColor = new Color(197, 255, 248);
          getContentPane().setBackground(backgroundColor);
          Gitbutton.setEnabled(false);
          AditextField.setText(user.getName());
          Gitbutton.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                  AditextField.setText(user.getName().toString());
                  if (!adi.equals("") ) {
                      user.setName(adi);
                      Ucuslar basla= new Ucuslar("Personel");
                      basla.setVisible(true);
                      setVisible(false);
                  }
              }
          });
      }
  
      public Duzelt(Ucus ucus) {
          initComponents();
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
              e.printStackTrace();
          }
          Gitbutton.setEnabled(false);
          Color backgroundColor = new Color(197, 255, 248);
          getContentPane().setBackground(backgroundColor);
      }
  
      public Duzelt(Ucak ucak) {
          initComponents();
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
              e.printStackTrace();
          }
          Gitbutton.setEnabled(false);
          Color backgroundColor = new Color(197, 255, 248);
          getContentPane().setBackground(backgroundColor);
      }
  
      public Duzelt(Yolcu yolcu) {
          initComponents();
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
              e.printStackTrace();
          }
          Gitbutton.setEnabled(false);
          Color backgroundColor = new Color(197, 255, 248);
          getContentPane().setBackground(backgroundColor);
      }
  
      public Duzelt(Sirket sirket) {
          initComponents();
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
              e.printStackTrace();
          }
          Color backgroundColor = new Color(197, 255, 248);
          getContentPane().setBackground(backgroundColor);
  
          Gitbutton.setEnabled(false);
          AditextField.setText(sirket.name);
          Gitbutton.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                  
                  if (!adi.equals("") && !adi.isEmpty()) {
                      sirket.setName(adi);
                      Ucuslar basla= new Ucuslar("Sirket");
                      basla.setVisible(true);
                      setVisible(false);
                  }
              }
          });
  
      }
  
      public Duzelt(Sefer sefer) {
          initComponents();
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
              e.printStackTrace();
          }
          AditextField.setText(sefer.nerden+" > "+sefer.nereye);
          Gitbutton.setEnabled(false);
          Color backgroundColor = new Color(197, 255, 248);
          getContentPane().setBackground(backgroundColor);
      }
      
      public Duzelt() {
          initComponents();
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
              e.printStackTrace();
          }
          Gitbutton.setEnabled(false);
          Color backgroundColor = new Color(197, 255, 248);
          getContentPane().setBackground(backgroundColor);
      }
      
      /**
       * 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() {
  
          jPanel1 = new javax.swing.JPanel();
          AditextField = new java.awt.TextField();
          label1 = new java.awt.Label();
          Gitbutton = new java.awt.Button();
          jPanel2 = new javax.swing.JPanel();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
          addWindowListener(new java.awt.event.WindowAdapter() {
              public void windowOpened(java.awt.event.WindowEvent evt) {
                  formWindowOpened(evt);
              }
          });
  
          jPanel1.setBackground(new java.awt.Color(150, 239, 255));
          jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  
          
  
          label1.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
          label1.setText("Adi");
  
          Gitbutton.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
          Gitbutton.setLabel("Kaydet");
  
          javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
          jPanel1.setLayout(jPanel1Layout);
          jPanel1Layout.setHorizontalGroup(
              jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel1Layout.createSequentialGroup()
                  .addContainerGap(115, Short.MAX_VALUE)
                  .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(57, 57, 57)
                  .addComponent(AditextField, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(85, 85, 85)
                  .addComponent(Gitbutton, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(98, 98, 98))
          );
          jPanel1Layout.setVerticalGroup(
              jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                  .addContainerGap(20, Short.MAX_VALUE)
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                      .addComponent(AditextField, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                      .addComponent(Gitbutton, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                      .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addGap(23, 23, 23))
          );
  
          jPanel2.setBackground(new java.awt.Color(150, 239, 255));
  
          javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
          jPanel2.setLayout(jPanel2Layout);
          jPanel2Layout.setHorizontalGroup(
              jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGap(0, 0, Short.MAX_VALUE)
          );
          jPanel2Layout.setVerticalGroup(
              jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGap(0, 202, Short.MAX_VALUE)
          );
  
          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(134, 134, 134)
                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                      .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                      .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                  .addContainerGap(228, Short.MAX_VALUE))
          );
          layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(54, 54, 54)
                  .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(29, 29, 29)
                  .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(293, Short.MAX_VALUE))
          );
  
          pack();
      }// </editor-fold>//GEN-END:initComponents
  
  
  
      private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
          AditextField.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                  adi = AditextField.getText();
                  if (!adi.equals("") && !adi.isEmpty()) {
                      Gitbutton.setEnabled(true);
                  }
              }
          });
      }//GEN-LAST:event_formWindowOpened
  
      /**
       * @param args the command line arguments
       */
      public static void main(String args[]) {
          /* Set the Nimbus look and feel */
          //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
          /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
           * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
           */
          try {
              for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                  if ("Nimbus".equals(info.getName())) {
                      javax.swing.UIManager.setLookAndFeel(info.getClassName());
                      break;
                  }
              }
          } catch (ClassNotFoundException ex) {
              java.util.logging.Logger.getLogger(Duzelt.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (InstantiationException ex) {
              java.util.logging.Logger.getLogger(Duzelt.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (IllegalAccessException ex) {
              java.util.logging.Logger.getLogger(Duzelt.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (javax.swing.UnsupportedLookAndFeelException ex) {
              java.util.logging.Logger.getLogger(Duzelt.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
          //</editor-fold>
  
          /* Create and display the form */
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new Duzelt().setVisible(true);
              }
          });
      }
  
      // Variables declaration - do not modify//GEN-BEGIN:variables
      private java.awt.TextField AditextField;
      private java.awt.Button Gitbutton;
      private javax.swing.JPanel jPanel1;
      private javax.swing.JPanel jPanel2;
      private java.awt.Label label1;
      // End of variables declaration//GEN-END:variables
  }
  