Advertisement
Guest User

info

a guest
Apr 6th, 2018
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 19.66 KB | None | 0 0
  1. package sound;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.EventQueue;
  5. import java.sql.Connection;
  6. import java.sql.DriverManager;
  7. import java.sql.ResultSet;
  8. import java.sql.SQLException;
  9. import java.sql.Statement;
  10.  
  11. import javax.swing.JFrame;
  12. import javax.swing.JPanel;
  13. import javax.swing.border.EmptyBorder;
  14.  
  15. import java.sql.*;
  16. import javax.swing.JLabel;
  17. import javax.swing.ImageIcon;
  18. import java.awt.Font;
  19. import java.awt.event.ActionEvent;
  20. import java.awt.event.ActionListener;
  21.  
  22. import javax.swing.JComboBox;
  23. import javax.swing.DefaultComboBoxModel;
  24. import javax.swing.JTextField;
  25. import javax.swing.JButton;
  26. import java.math.BigDecimal;
  27.  
  28.  
  29. public class webshop extends JFrame {
  30.  
  31.     private JPanel contentPane;
  32.     private JTextField tfPreis;
  33.     private JTextField tfvorname;
  34.     private JTextField tfnachname;
  35.     private JTextField tfstrasse;
  36.     private JTextField tfhausnummer;
  37.     private JTextField tfpostleitzahl;
  38.     private JTextField tfid;
  39.    
  40.     /*Variablendeklaration*/
  41.     double Gitarre;
  42.     double Gibson, Takamine, HarleyBentonSC, HarleyBenton, Ortega, Cordoba;
  43.     double GibsonP, TakamineP, HarleyBentonSCP, HarleyBentonP, OrtegaP, CordobaP;
  44.  
  45.     /**
  46.      * Launch the application.
  47.      */
  48.     public static void main (String[] args) {
  49.        
  50.         EventQueue.invokeLater(new Runnable() {
  51.             public void run() {
  52.                 try {
  53.                     webshop frame = new webshop();
  54.                     frame.setVisible(true);
  55.                 } catch (Exception e) {
  56.                     e.printStackTrace();
  57.                 }
  58.             }          
  59.         });
  60.         createConnection();
  61.         createConnection2();
  62.            
  63.     }
  64.    
  65.     public static void createConnection() {
  66.         final String hostname = "localhost";
  67.         final String port = "3306";
  68.         final String dbname = "gitarrenwebshopdb";
  69.         final String user = "root";
  70.         final String password = "root";
  71.        
  72.         Connection conn = null;
  73.          
  74.             try {
  75.             System.out.println("* Treiber laden");
  76.                 Class.forName("com.mysql.jdbc.Driver").newInstance();
  77.             }
  78.             catch (Exception e) {
  79.                 System.err.println("Unable to load driver.");
  80.                 e.printStackTrace();
  81.             }
  82.         try {
  83.             System.out.println("* Verbindung aufbauen");
  84.             String url = "jdbc:mysql://"+hostname+":"+port+"/"+dbname;
  85.             conn = DriverManager.getConnection(url, user, password);
  86.            
  87.                 System.out.println("* Statement beginnen");
  88.                 Statement stmt = conn.createStatement();
  89.  
  90.                 System.out.println("* Abfrage beginnen");
  91.                 String sqlCommand = "SELECT ID, Artikel, Preis FROM artikeltb";
  92.                 ResultSet rs = stmt.executeQuery(sqlCommand);
  93.            
  94.                 System.out.println("* Ergebnisse anzeigen");
  95.                 while (rs.next()) {
  96.                     String id = rs.getString(1);
  97.                     String artikel = rs.getString("Artikel");
  98.                     double preis = rs.getDouble(3);
  99.                     System.out.println( id +" "+artikel+" "+preis );
  100.                 }
  101.                
  102.                 System.out.println("* Statement beenden");
  103.                 stmt.close();
  104.                 System.out.println("* Datenbank-Verbindung beenden");
  105.                 conn.close();
  106.             }
  107.             catch (SQLException sqle) {
  108.                 System.out.println("SQLException: " + sqle.getMessage());
  109.                 System.out.println("SQLState: " + sqle.getSQLState());
  110.                 System.out.println("VendorError: " + sqle.getErrorCode());
  111.                 sqle.printStackTrace();
  112.             }
  113.     }
  114.    
  115.     public static void createConnection2() {
  116.         final String hostname = "localhost";
  117.         final String port = "3306";
  118.         final String dbname = "gitarrenwebshopdb";
  119.         final String user = "root";
  120.         final String password = "root";
  121.        
  122.         Connection conn = null;
  123.          
  124.             try {
  125.             System.out.println("* Treiber laden");
  126.                 Class.forName("com.mysql.jdbc.Driver").newInstance();
  127.             }
  128.             catch (Exception e) {
  129.                 System.err.println("Unable to load driver.");
  130.                 e.printStackTrace();
  131.             }
  132.         try {
  133.             System.out.println("* Verbindung aufbauen");
  134.             String url = "jdbc:mysql://"+hostname+":"+port+"/"+dbname;
  135.             conn = DriverManager.getConnection(url, user, password);
  136.            
  137.                 System.out.println("* Statement beginnen");
  138.                 Statement stmt = conn.createStatement();
  139.  
  140.                 System.out.println("* Abfrage beginnen");
  141.             String sqlCommand =
  142.             "SELECT ID, Vorname, Nachname, Strasse, Hausnummer, Postleitzahl, Zahlungsart, Artikel FROM bestellungtb";
  143.                 ResultSet rs = stmt.executeQuery(sqlCommand);
  144.            
  145.                 System.out.println("* Ergebnisse anzeigen");
  146.             while (rs.next()) {
  147.             String id2 = rs.getString(1);
  148.             String Vorname = rs.getString(2);
  149.             String Nachname = rs.getString(3);
  150.             String Strasse = rs.getString(4);
  151.             double Hausnummer = rs.getDouble(5);
  152.             double Postleitzahl = rs.getDouble(6);
  153.             String Zahlungsart = rs.getString(7);
  154.             String Artikel2 = rs.getString(8);
  155.             double Preis2 = rs.getDouble(9);
  156.            
  157.             System.out.println( id2 +" "+Vorname+" "+Nachname+" "+Strasse+" "+Hausnummer+" "+Postleitzahl+" "+Zahlungsart+" "+Artikel2+" "+Preis2 );
  158.             }
  159.  
  160.             System.out.println("* Statement beenden");
  161.             stmt.close();
  162.             System.out.println("* Datenbank-Verbindung beenden");
  163.             conn.close();
  164.             }
  165.             catch (SQLException sqle) {
  166.                 System.out.println("SQLException: " + sqle.getMessage());
  167.                 System.out.println("SQLState: " + sqle.getSQLState());
  168.                 System.out.println("VendorError: " + sqle.getErrorCode());
  169.                 sqle.printStackTrace();
  170.             }
  171.         return;
  172.        
  173.     }
  174.    
  175.     public int eintragen(String Vorname , String Nachname, String Strasse, String Hausnummer, String Postleitzahl, String Zahlungsart, String Artikel2, String Preis2) {
  176.         Connection conn = null;
  177.         try {
  178.             conn = DriverManager.getConnection("jdbc:mysql://localhost/login?user=root&password=root");
  179.             Statement stmt = conn.createStatement();
  180.             return stmt.executeUpdate("INSERT INTO bestellungtb(Vorname) VALUES('"+ Vorname +"' , '"+ Nachname +"', '"+ Strasse +"' , '"+ Hausnummer +"' , '"+ Postleitzahl +"', '"+ Zahlungsart +"' , '"+ Artikel2 +"' , '"+ Preis2 +"')");
  181.         }
  182.         catch (SQLException e) {
  183.             return 0;
  184.         }
  185.     }
  186.  
  187.     /**
  188.      * Create the frame.
  189.      */
  190.     public webshop() {
  191.         setTitle("Gitarrenwebshop");
  192.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  193.         setBounds(100, 100, 727, 720);
  194.         contentPane = new JPanel();
  195.         contentPane.setFont(new Font("Tahoma", Font.BOLD, 11));
  196.         contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  197.         setContentPane(contentPane);
  198.         contentPane.setLayout(null);
  199.        
  200.         /*******************************************************
  201.          ******************* Labels ****************************
  202.          *******************************************************/
  203.        
  204.         JLabel lblgibson = new JLabel("");
  205.         lblgibson.setVisible(false);
  206.         lblgibson.setIcon(new ImageIcon(webshop.class.getResource("/sound/gibson.jpg")));
  207.         lblgibson.setBounds(10, 39, 131, 400);
  208.         contentPane.add(lblgibson);
  209.        
  210.         JLabel lblcordoba = new JLabel("");
  211.         lblcordoba.setVisible(false);
  212.         lblcordoba.setIcon(new ImageIcon(webshop.class.getResource("/sound/cordoba.jpg")));
  213.         lblcordoba.setBounds(10, 39, 158, 400);
  214.         contentPane.add(lblcordoba);
  215.        
  216.         JLabel lblharleybentonsc = new JLabel("");
  217.         lblharleybentonsc.setVisible(false);
  218.         lblharleybentonsc.setIcon(new ImageIcon(webshop.class.getResource("/sound/harley_benton_sc.jpg")));
  219.         lblharleybentonsc.setBounds(10, 39, 131, 400);
  220.         contentPane.add(lblharleybentonsc);
  221.        
  222.         JLabel lblharleybenton = new JLabel("");
  223.         lblharleybenton.setIcon(new ImageIcon(webshop.class.getResource("/sound/harley_benton.jpg")));
  224.         lblharleybenton.setVisible(false);
  225.         lblharleybenton.setBounds(10, 39, 158, 400);
  226.         contentPane.add(lblharleybenton);
  227.        
  228.         JLabel lblortega = new JLabel("");
  229.         lblortega.setIcon(new ImageIcon(webshop.class.getResource("/sound/ortega.jpg")));
  230.         lblortega.setVisible(false);
  231.         lblortega.setBounds(10, 39, 145, 400);
  232.         contentPane.add(lblortega);
  233.        
  234.         JLabel lbltakamine = new JLabel("");
  235.         lbltakamine.setVisible(false);
  236.         lbltakamine.setIcon(new ImageIcon(webshop.class.getResource("/sound/takamine.jpg")));
  237.         lbltakamine.setBounds(10, 39, 158, 400);
  238.         contentPane.add(lbltakamine);
  239.        
  240.         JLabel lblauswahl = new JLabel("");
  241.         lblauswahl.setIcon(new ImageIcon(webshop.class.getResource("/sound/auswahl.jpg")));
  242.         lblauswahl.setBounds(10, 39, 152, 400);
  243.         contentPane.add(lblauswahl);
  244.        
  245.         JLabel lblgitarrenauswahl = new JLabel("Gitarrenauswahl:");
  246.         lblgitarrenauswahl.setFont(new Font("Tahoma", Font.BOLD, 11));
  247.         lblgitarrenauswahl.setBounds(10, 11, 691, 20);
  248.         contentPane.add(lblgitarrenauswahl);
  249.        
  250.         JLabel lblInfo = new JLabel("(Jede Gitarre ist auch f\u00FCr einen Aufpreis von 50 Euro in einem Pack (Stimmger\u00E4t, Gigpack, Gurt) erh\u00E4ltlich)");
  251.         lblInfo.setFont(new Font("Tahoma", Font.PLAIN, 11));
  252.         lblInfo.setBounds(178, 11, 523, 20);
  253.         contentPane.add(lblInfo);
  254.        
  255.         JLabel lblpreis = new JLabel("Preis (EUR)");
  256.         lblpreis.setFont(new Font("Tahoma", Font.BOLD, 11));
  257.         lblpreis.setBounds(365, 425, 76, 14);
  258.         contentPane.add(lblpreis);
  259.        
  260.         JLabel lblvorname = new JLabel("Vorname");
  261.         lblvorname.setFont(new Font("Tahoma", Font.BOLD, 11));
  262.         lblvorname.setBounds(178, 71, 76, 14);
  263.         contentPane.add(lblvorname);
  264.        
  265.         JLabel lblnachname = new JLabel("Nachname");
  266.         lblnachname.setFont(new Font("Tahoma", Font.BOLD, 11));
  267.         lblnachname.setBounds(178, 134, 108, 14);
  268.         contentPane.add(lblnachname);
  269.        
  270.         JLabel lblstrasse = new JLabel("Strasse");
  271.         lblstrasse.setFont(new Font("Tahoma", Font.BOLD, 11));
  272.         lblstrasse.setBounds(178, 190, 46, 14);
  273.         contentPane.add(lblstrasse);
  274.        
  275.         JLabel lblhausnummer = new JLabel("Hausnummer");
  276.         lblhausnummer.setFont(new Font("Tahoma", Font.BOLD, 11));
  277.         lblhausnummer.setBounds(390, 190, 171, 14);
  278.         contentPane.add(lblhausnummer);
  279.        
  280.         JLabel lblpostleitzahl = new JLabel("Postleitzahl");
  281.         lblpostleitzahl.setFont(new Font("Tahoma", Font.BOLD, 11));
  282.         lblpostleitzahl.setBounds(178, 246, 94, 14);
  283.         contentPane.add(lblpostleitzahl);
  284.        
  285.         JLabel lblzahlungsart = new JLabel("Zahlungsart");
  286.         lblzahlungsart.setFont(new Font("Tahoma", Font.BOLD, 11));
  287.         lblzahlungsart.setBounds(178, 303, 94, 14);
  288.         contentPane.add(lblzahlungsart);
  289.        
  290.         JLabel lblbestellungen = new JLabel("Bestellung einsehen:");
  291.         lblbestellungen.setFont(new Font("Tahoma", Font.BOLD, 11));
  292.         lblbestellungen.setBounds(10, 529, 131, 14);
  293.         contentPane.add(lblbestellungen);
  294.        
  295.         JLabel lblid = new JLabel("ID");
  296.         lblid.setFont(new Font("Dialog", Font.BOLD, 12));
  297.         lblid.setBounds(10, 554, 46, 14);
  298.         contentPane.add(lblid);
  299.        
  300.         JLabel lblausgabe = new JLabel("");
  301.         lblausgabe.setBounds(10, 492, 691, 14);
  302.         contentPane.add(lblausgabe);
  303.        
  304.         JLabel lblpruefen = new JLabel("");
  305.         lblpruefen.setBounds(10, 608, 691, 14);
  306.         contentPane.add(lblpruefen);
  307.        
  308.         /*******************************************************
  309.          ******************* Textfelder ************************
  310.          *******************************************************/
  311.        
  312.         tfPreis = new JTextField();
  313.         tfPreis.setEditable(false);
  314.         tfPreis.setBounds(365, 450, 120, 20);
  315.         contentPane.add(tfPreis);
  316.         tfPreis.setColumns(10);
  317.        
  318.         tfvorname = new JTextField();
  319.         tfvorname.setBounds(178, 96, 202, 20);
  320.         contentPane.add(tfvorname);
  321.         tfvorname.setColumns(10);
  322.        
  323.         tfnachname = new JTextField();
  324.         tfnachname.setBounds(178, 159, 202, 20);
  325.         contentPane.add(tfnachname);
  326.         tfnachname.setColumns(10);
  327.        
  328.         tfstrasse = new JTextField();
  329.         tfstrasse.setBounds(178, 215, 202, 20);
  330.         contentPane.add(tfstrasse);
  331.         tfstrasse.setColumns(10);
  332.        
  333.         tfhausnummer = new JTextField();
  334.         tfhausnummer.setBounds(390, 215, 86, 20);
  335.         contentPane.add(tfhausnummer);
  336.         tfhausnummer.setColumns(10);
  337.        
  338.         tfid = new JTextField();
  339.         tfid.setBounds(10, 579, 86, 20);
  340.         contentPane.add(tfid);
  341.         tfid.setColumns(10);
  342.        
  343.         tfpostleitzahl = new JTextField();
  344.         tfpostleitzahl.setText("");
  345.         tfpostleitzahl.setBounds(178, 272, 134, 20);
  346.         contentPane.add(tfpostleitzahl);
  347.         tfpostleitzahl.setColumns(10);
  348.        
  349.         /*******************************************************
  350.          ******************* Buttons ***************************
  351.          *******************************************************/
  352.        
  353.         JButton btnbestellen = new JButton("Bestellen");
  354.         btnbestellen.setFont(new Font("Tahoma", Font.BOLD, 11));
  355.         btnbestellen.setBounds(530, 449, 171, 23);
  356.         contentPane.add(btnbestellen);
  357.        
  358.         JButton btnBeenden = new JButton("Beenden");
  359.         btnBeenden.setFont(new Font("Tahoma", Font.BOLD, 11));
  360.         btnBeenden.setBounds(530, 647, 171, 23);
  361.         contentPane.add(btnBeenden);
  362.        
  363.         JButton btnpruefen = new JButton("Pruefen");
  364.         btnpruefen.setFont(new Font("Tahoma", Font.BOLD, 11));
  365.         btnpruefen.setBounds(530, 578, 171, 23);
  366.         contentPane.add(btnpruefen);
  367.        
  368.         /*******************************************************
  369.          ******************* ComboBox **************************
  370.          *******************************************************/
  371.        
  372.         JComboBox cbzahlungsart = new JComboBox();
  373.         cbzahlungsart.setModel(new DefaultComboBoxModel(new String[] {"--Bitte waehlen--", "Paypal", "Lastschrift", "Visa", "Nachname (+10 Euro)"}));
  374.        
  375.         cbzahlungsart.addActionListener(new ActionListener() {
  376.             public void actionPerformed(ActionEvent arg0) {
  377.                
  378.             }
  379.            
  380.         });
  381.            
  382.         cbzahlungsart.setBounds(178, 328, 202, 20);
  383.         contentPane.add(cbzahlungsart);
  384.        
  385.         JComboBox cbgitarre = new JComboBox();
  386.         cbgitarre.setModel(new DefaultComboBoxModel(new String[] {"--Bitte waehlen--", "Gibson Les Paul Tribute 2018 FHB", "Gibson Les Paul Tribute 2018 FHB (Pack)", "Harley Benton SC-1000 VB Progressive Line", "Harley Benton SC-1000 VB Progressive Line (Pack)", "Ortega R121-1/4 NT", "Ortega R121-1/4 NT (Pack)", "Cordoba C9 Parlor", "Cordoba C9 Parlor (Pack)", "Harley Benton D-120CE BK", "Harley Benton D-120CE BK (Pack)", "Takamine EF341SC", "Takamine EF341SC (Pack)"}));
  387.         cbgitarre.addActionListener(new ActionListener() {
  388.             public void actionPerformed(ActionEvent arg0) {
  389.                
  390.                 /*Es wird in den folgenden If-Abfragen geschaut, was in der ComboBox cbgitarre ausgewählt ist und danach der Variablen Gitarre
  391.                  * ein Wert zugeordnet. Zusätzlich wird das passende Bild ausgegeben und die nicht passenden wieder unsichtbar gemacht.*/
  392.                 if(cbgitarre.getSelectedItem().equals("--Bitte waehlen--")) {
  393.                    
  394.                    
  395.                     Gitarre = 0;
  396.                     lblauswahl.setVisible(true);
  397.                     lblgibson.setVisible(false);
  398.                     lbltakamine.setVisible(false);
  399.                     lblharleybenton.setVisible(false);
  400.                     lblharleybentonsc.setVisible(false);
  401.                     lblortega.setVisible(false);
  402.                     lblcordoba.setVisible(false);
  403.                 }
  404.                
  405.                 if(cbgitarre.getSelectedItem().equals("Gibson Les Paul Tribute 2018 FHB")) {
  406.                    
  407.                     Gitarre = 1;
  408.                     lblauswahl.setVisible(false);
  409.                     lblgibson.setVisible(true);
  410.                     lbltakamine.setVisible(false);
  411.                     lblharleybenton.setVisible(false);
  412.                     lblharleybentonsc.setVisible(false);
  413.                     lblortega.setVisible(false);
  414.                     lblcordoba.setVisible(false);
  415.                    
  416.                 }
  417.                
  418.                 if(cbgitarre.getSelectedItem().equals("Gibson Les Paul Tribute 2018 FHB (Pack)")) {
  419.                    
  420.                     Gitarre = 2;
  421.                     lblauswahl.setVisible(false);
  422.                     lblgibson.setVisible(true);
  423.                     lbltakamine.setVisible(false);
  424.                     lblharleybenton.setVisible(false);
  425.                     lblharleybentonsc.setVisible(false);
  426.                     lblortega.setVisible(false);
  427.                     lblcordoba.setVisible(false);
  428.                    
  429.                 }
  430.                
  431.                 if(cbgitarre.getSelectedItem().equals("Harley Benton SC-1000 VB Progressive Line")) {
  432.                    
  433.                     Gitarre = 3;
  434.                     lblauswahl.setVisible(false);
  435.                     lblgibson.setVisible(false);
  436.                     lbltakamine.setVisible(false);
  437.                     lblharleybenton.setVisible(false);
  438.                     lblharleybentonsc.setVisible(true);
  439.                     lblortega.setVisible(false);
  440.                     lblcordoba.setVisible(false);
  441.                    
  442.                 }
  443.                
  444.                 if(cbgitarre.getSelectedItem().equals("Harley Benton SC-1000 VB Progressive Line (Pack)")) {
  445.                    
  446.                     Gitarre = 4;
  447.                     lblauswahl.setVisible(false);
  448.                     lblgibson.setVisible(false);
  449.                     lbltakamine.setVisible(false);
  450.                     lblharleybenton.setVisible(false);
  451.                     lblharleybentonsc.setVisible(true);
  452.                     lblortega.setVisible(false);
  453.                     lblcordoba.setVisible(false);
  454.                    
  455.                 }
  456.                
  457.                 if(cbgitarre.getSelectedItem().equals("Ortega R121-1/4 NT")) {
  458.                    
  459.                     Gitarre = 5;
  460.                     lblauswahl.setVisible(false);
  461.                     lblgibson.setVisible(false);
  462.                     lbltakamine.setVisible(false);
  463.                     lblharleybenton.setVisible(false);
  464.                     lblharleybentonsc.setVisible(false);
  465.                     lblortega.setVisible(true);
  466.                     lblcordoba.setVisible(false);
  467.                    
  468.                 }
  469.                
  470.                 if(cbgitarre.getSelectedItem().equals("Ortega R121-1/4 NT (Pack)")) {
  471.                    
  472.                     Gitarre = 6;
  473.                     lblauswahl.setVisible(false);
  474.                     lblgibson.setVisible(false);
  475.                     lbltakamine.setVisible(false);
  476.                     lblharleybenton.setVisible(false);
  477.                     lblharleybentonsc.setVisible(false);
  478.                     lblortega.setVisible(true);
  479.                     lblcordoba.setVisible(false);
  480.                    
  481.                 }
  482.                
  483.                 if(cbgitarre.getSelectedItem().equals("Cordoba C9 Parlor")) {
  484.                    
  485.                     Gitarre = 7;
  486.                     lblauswahl.setVisible(false);
  487.                     lblgibson.setVisible(false);
  488.                     lbltakamine.setVisible(false);
  489.                     lblharleybenton.setVisible(false);
  490.                     lblharleybentonsc.setVisible(false);
  491.                     lblortega.setVisible(false);
  492.                     lblcordoba.setVisible(true);
  493.                    
  494.                 }
  495.                
  496.                 if(cbgitarre.getSelectedItem().equals("Cordoba C9 Parlor (Pack)")) {
  497.                    
  498.                     Gitarre = 8;
  499.                     lblauswahl.setVisible(false);
  500.                     lblgibson.setVisible(false);
  501.                     lbltakamine.setVisible(false);
  502.                     lblharleybenton.setVisible(false);
  503.                     lblharleybentonsc.setVisible(false);
  504.                     lblortega.setVisible(false);
  505.                     lblcordoba.setVisible(true);
  506.                    
  507.                 }
  508.                
  509.                 if(cbgitarre.getSelectedItem().equals("Harley Benton D-120CE BK")) {
  510.                    
  511.                     Gitarre = 9;
  512.                     lblauswahl.setVisible(false);
  513.                     lblgibson.setVisible(false);
  514.                     lbltakamine.setVisible(false);
  515.                     lblharleybenton.setVisible(true);
  516.                     lblharleybentonsc.setVisible(false);
  517.                     lblortega.setVisible(false);
  518.                     lblcordoba.setVisible(false);
  519.                    
  520.                 }
  521.                
  522.                 if(cbgitarre.getSelectedItem().equals("Harley Benton D-120CE BK (Pack)")) {
  523.                    
  524.                     Gitarre = 10;
  525.                     lblauswahl.setVisible(false);
  526.                     lblgibson.setVisible(false);
  527.                     lbltakamine.setVisible(false);
  528.                     lblharleybenton.setVisible(true);
  529.                     lblharleybentonsc.setVisible(false);
  530.                     lblortega.setVisible(false);
  531.                     lblcordoba.setVisible(false);
  532.                    
  533.                 }
  534.                
  535.                 if(cbgitarre.getSelectedItem().equals("Takamine EF341SC")) {
  536.                    
  537.                     Gitarre = 11;
  538.                     lblauswahl.setVisible(false);
  539.                     lblgibson.setVisible(false);
  540.                     lbltakamine.setVisible(true);
  541.                     lblharleybenton.setVisible(false);
  542.                     lblharleybentonsc.setVisible(false);
  543.                     lblortega.setVisible(false);
  544.                     lblcordoba.setVisible(false);
  545.                    
  546.                 }
  547.                
  548.                 if(cbgitarre.getSelectedItem().equals("Takamine EF341SC (Pack)")) {
  549.                    
  550.                     Gitarre = 12;
  551.                     lblauswahl.setVisible(false);
  552.                     lblgibson.setVisible(false);
  553.                     lbltakamine.setVisible(true);
  554.                     lblharleybenton.setVisible(false);
  555.                     lblharleybentonsc.setVisible(false);
  556.                     lblortega.setVisible(false);
  557.                     lblcordoba.setVisible(false);
  558.                    
  559.                 }
  560.                
  561.             }
  562.            
  563.         });
  564.        
  565.         cbgitarre.setBounds(10, 450, 323, 20);
  566.         contentPane.add(cbgitarre);
  567.        
  568.         /*******************************************************
  569.          ******************* btnBeenden ************************
  570.          *******************************************************/
  571.        
  572.         btnBeenden.addActionListener(new ActionListener() {
  573.             public void actionPerformed(ActionEvent e) {
  574.                 System.exit(0);
  575.             }
  576.         });
  577.        
  578.         btnbestellen.addActionListener(new ActionListener() {
  579.             public void actionPerformed(ActionEvent arg0) {
  580.                
  581.             }
  582.         });
  583.     }
  584. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement