CI 2019 von Daniel, Eugen und Michael
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.4 KiB

  1. import java.awt.JobAttributes;
  2. import java.awt.event.ActionEvent;
  3. import java.awt.event.ActionListener;
  4. import javax.swing.JOptionPane;
  5. import javax.swing.*;
  6. public class Quiz_E {
  7. JFrame fr = null;
  8. JPanel contentPane = null;
  9. JButton button1 = null;
  10. JLabel label1 = null;
  11. JLabel label2 = null;
  12. JLabel label3 = null;
  13. JLabel label4 = null;
  14. JLabel label5 = null;
  15. JLabel label6 = null;
  16. JLabel label7 = null;
  17. JTextField j1 = null;
  18. JTextField j2 = null;
  19. JTextField j3 = null;
  20. JTextField j4 = null;
  21. JMenuItem menuItem1 = null;
  22. JMenuItem menuItem2 = null;
  23. JOptionPane opane = null;
  24. JMenuBar bar =null;
  25. JMenu mF= null;
  26. JMenu mH = null;
  27. int button1warsovielmalgedrückt = 0;
  28. public Quiz_E() {
  29. this.fr = new JFrame("GUI");
  30. this.fr.setSize(300, 900);
  31. this.contentPane = new JPanel();
  32. this.fr.setContentPane(this.contentPane);
  33. this.bar = new JMenuBar();
  34. this.fr.setJMenuBar(bar);
  35. this.mF = new JMenu("File");
  36. this.mH = new JMenu("Help");
  37. this.bar.add(mF);
  38. this.bar.add(mH);
  39. this.menuItem1 = new JMenuItem("Exit");
  40. this.mF.add(menuItem1);
  41. this.menuItem2 = new JMenuItem("Info");
  42. this.mH.add(menuItem2);
  43. this.label4= new JLabel("Das spiel wird ihr Leben verändern.");
  44. this.contentPane.add(label4);
  45. this.label5= new JLabel("Wollen Sie erfahren, Wie viel Zeit bleibt dir in deinem Leben noch?");
  46. this.contentPane.add(label5);
  47. this.label1 = new JLabel("Wie ist Ihr Name?");
  48. this.contentPane.add(label1);
  49. this.j1 = new JTextField("", 20);
  50. this.contentPane.add(j1);
  51. this.j1.setSize(160,20);;
  52. this.label2 = new JLabel("Wie alt sind Sie?");
  53. this.contentPane.add(label2);
  54. this.j2 = new JTextField("", 20);
  55. this.contentPane.add(j2);
  56. this.j2.setSize(160,20);
  57. this.label3 = new JLabel("Was machen Sie beruflich?");
  58. this.contentPane.add(label3);
  59. this.j3 = new JTextField("", 20);
  60. this.contentPane.add(j3);
  61. this.button1 = new JButton("Erfahren");
  62. this.contentPane.add(button1);
  63. this.j4 = new JTextField("Sie sterben in ___ Jahren!");
  64. this.contentPane.add(j4);
  65. this.label6 = new JLabel("Die Wahrheit ist schwer zu ertragen.");
  66. this.contentPane.add(label6);
  67. this.label7 = new JLabel("ich hab eine Lösung für dich!");
  68. this.contentPane.add(label7);
  69. this.fr.setVisible(true);
  70. }
  71. public static void main(String[] args) {
  72. Quiz_E q = new Quiz_E();
  73. }
  74. }