Browse Source

Quiz Spiel. 1 Frage und Antwort

new_repo
Komlovski 3 years ago
parent
commit
4f385b404c
  1. 2
      .idea/misc.xml
  2. 238
      .idea/workspace.xml
  3. BIN
      out/production/Alpha/Main.class
  4. BIN
      out/production/Alpha/Quiz_E.class
  5. 140
      src/Quiz.java
  6. 107
      src/Quiz_E.java

2
.idea/misc.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

238
.idea/workspace.xml

@ -2,8 +2,12 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="41dc023d-0769-466f-850a-8e3eed9fe5fa" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/out/production/Alpha/Main.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Quiz.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Tage_D.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Tage_D.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/Alpha/Quiz_E.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/Quiz_E.java" beforeDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -15,24 +19,53 @@
<component name="DefaultGradleProjectSettings">
<option name="isMigrated" value="true" />
</component>
<component name="ExportToHTMLSettings">
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/../Alpha\exportToHTML" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="610">
<caret line="97" selection-start-line="97" selection-end-line="97" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Tage_D.java">
<entry file="file://$PROJECT_DIR$/src/Quiz.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391">
<caret line="54" column="44" lean-forward="true" selection-start-line="54" selection-start-column="44" selection-end-line="54" selection-end-column="44" />
<state relative-caret-position="204">
<caret line="105" column="40" selection-start-line="105" selection-start-column="40" selection-end-line="105" selection-end-column="40" />
<folding>
<element signature="e#2655#2656#0" expanded="true" />
<element signature="e#3183#3184#0" expanded="true" />
<element signature="e#3238#3239#0" expanded="true" />
<element signature="e#3364#3365#0" expanded="true" />
<element signature="e#3419#3420#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/D_Test2.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/D_Test3.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
@ -42,18 +75,6 @@
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>pa.</find>
<find>contantPane</find>
<find>this.</find>
</findStrings>
<replaceStrings>
<replace>this.</replace>
<replace>this.panel</replace>
<replace>Panele</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
@ -65,14 +86,18 @@
<option value="$PROJECT_DIR$/src/geburtstag.java" />
<option value="$PROJECT_DIR$/src/Geburtstag.java" />
<option value="$PROJECT_DIR$/src/Main.java" />
<option value="$PROJECT_DIR$/src/Tage_D.java" />
<option value="$PROJECT_DIR$/src/TicTakToc_E_K.java" />
<option value="$PROJECT_DIR$/src/Quiz_E.java" />
<option value="$PROJECT_DIR$/src/RadioQuestion.java" />
<option value="$PROJECT_DIR$/src/Quiz.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="-7" />
<option name="width" value="974" />
<option name="height" value="1057" />
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1346" />
<option name="height" value="728" />
</component>
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
@ -107,9 +132,8 @@
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="restartRequiresConfirmation" value="false" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
@ -123,37 +147,37 @@
</list>
</option>
</component>
<component name="RunManager" selected="Application.Tage_D">
<configuration name="D_Geburtstag" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="D_Geburtstag" />
<component name="RunManager" selected="Application.Quiz">
<configuration name="TicTakToc_E_K" type="Applet" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="TicTakToc_E_K" />
<module name="Alpha" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="D_Test1" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="D_Test1" />
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="Alpha" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<configuration name="Quiz" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Quiz" />
<module name="Alpha" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Tage_D" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Tage_D" />
<configuration name="Quiz_E" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Quiz_E" />
<module name="Alpha" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="main" />
<configuration name="TicTakToc_E_K" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="TicTakToc_E_K" />
<module name="Alpha" />
<method v="2">
<option name="Make" enabled="true" />
@ -161,11 +185,11 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Tage_D" />
<item itemvalue="Application.Quiz" />
<item itemvalue="Application.Quiz_E" />
<item itemvalue="Applet.TicTakToc_E_K" />
<item itemvalue="Application.TicTakToc_E_K" />
<item itemvalue="Application.Main" />
<item itemvalue="Application.D_Test1" />
<item itemvalue="Application.D_Geburtstag" />
<item itemvalue="Application.main" />
</list>
</recent_temporary>
</component>
@ -184,8 +208,8 @@
<workItem from="1562343569757" duration="85000" />
<workItem from="1562343774281" duration="2056000" />
<workItem from="1562347057096" duration="199000" />
<workItem from="1562379817416" duration="627000" />
<workItem from="1562534024971" duration="213000" />
<workItem from="1562363354568" duration="615000" />
<workItem from="1562414362573" duration="942000" />
</task>
<task id="LOCAL-00001" summary="neue master">
<created>1562341097724</created>
@ -243,64 +267,43 @@
<option name="project" value="LOCAL" />
<updated>1562348184129</updated>
</task>
<task id="LOCAL-00009" summary="Fenster wird um Auswahl Fenster erweitert">
<created>1562349172389</created>
<task id="LOCAL-00009" summary="Beginn mit Quiz Spiel.&#10;//erste Giu elemente">
<created>1562415232279</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1562349172389</updated>
<updated>1562415232279</updated>
</task>
<task id="LOCAL-00010" summary="Fenster wird um Auswahl Fenster erweitert">
<created>1562349989934</created>
<option name="number" value="00010" />
<option name="presentableId" value="LOCAL-00010" />
<option name="project" value="LOCAL" />
<updated>1562349989934</updated>
</task>
<task id="LOCAL-00011" summary="neue Tage Script">
<created>1562537775488</created>
<option name="number" value="00011" />
<option name="presentableId" value="LOCAL-00011" />
<option name="project" value="LOCAL" />
<updated>1562537775489</updated>
</task>
<task id="LOCAL-00012" summary="neue Tage Script">
<created>1562537854358</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1562537854358</updated>
</task>
<option name="localTasksCounter" value="13" />
<option name="localTasksCounter" value="10" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="12420000" />
<option name="totallyTimeSpent" value="15788000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1066" extended-state="6" />
<frame x="-8" y="-8" width="1382" height="784" extended-state="6" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.07942431" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.49885583" visible="true" weight="0.26928896" />
<window_info id="Structure" order="1" sideWeight="0.5011442" side_tool="true" visible="true" weight="0.26928896" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Messages" order="0" weight="0.3290461" />
<window_info anchor="bottom" id="Messages" order="0" sideWeight="0.4977307" weight="0.32872504" />
<window_info anchor="bottom" id="Message" order="1" />
<window_info anchor="bottom" id="Find" order="2" />
<window_info active="true" anchor="bottom" id="Run" order="3" visible="true" weight="0.33118972" />
<window_info anchor="bottom" id="Debug" order="4" weight="0.39978564" />
<window_info active="true" anchor="bottom" id="Run" order="3" sideWeight="0.49621785" visible="true" weight="0.32872504" />
<window_info anchor="bottom" id="Debug" order="4" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="7" />
<window_info anchor="bottom" id="Docker" order="8" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="9" weight="0.3290461" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Database Changes" order="10" />
<window_info anchor="bottom" id="Terminal" order="11" weight="0.3290461" />
<window_info anchor="bottom" id="Event Log" order="12" side_tool="true" />
<window_info anchor="bottom" id="Terminal" order="11" sideWeight="0.49924356" weight="0.32872504" />
<window_info anchor="bottom" id="Event Log" order="12" sideWeight="0.50378215" side_tool="true" visible="true" weight="0.32872504" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@ -311,6 +314,37 @@
<window_info anchor="right" id="Palette&#9;" order="7" />
<window_info anchor="right" id="Database" order="8" />
</layout>
<layout-to-restore>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.25416037" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Messages" order="0" weight="0.32934928" />
<window_info anchor="bottom" id="Message" order="1" />
<window_info anchor="bottom" id="Find" order="2" />
<window_info active="true" anchor="bottom" id="Run" order="3" sideWeight="0.49924356" visible="true" weight="0.32872504" />
<window_info anchor="bottom" id="Debug" order="4" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="7" />
<window_info anchor="bottom" id="Docker" order="8" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Database Changes" order="10" />
<window_info anchor="bottom" id="Terminal" order="11" weight="0.32934928" />
<window_info anchor="bottom" id="Event Log" order="12" sideWeight="0.50075644" side_tool="true" visible="true" weight="0.32872504" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Theme Preview" order="4" />
<window_info anchor="right" id="Maven" order="5" />
<window_info anchor="right" id="Capture Analysis" order="6" />
<window_info anchor="right" id="Palette&#9;" order="7" />
<window_info anchor="right" id="Database" order="8" />
</layout-to-restore>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
@ -320,9 +354,11 @@
<MESSAGE value="geburtstag sauber" />
<MESSAGE value="Main bereinigt" />
<MESSAGE value="junit klassen erst mal entfernen" />
<MESSAGE value="Fenster wird um Auswahl Fenster erweitert" />
<MESSAGE value="neue Tage Script" />
<option name="LAST_COMMIT_MESSAGE" value="neue Tage Script" />
<MESSAGE value="Beginn mit Quiz Spiel.&#10;//erste Giu elemente" />
<option name="LAST_COMMIT_MESSAGE" value="Beginn mit Quiz Spiel.&#10;//erste Giu elemente" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/Alpha$Quiz.ic" NAME="Quiz Coverage Results" MODIFIED="1562358075708" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/testJFrame.java" />
@ -347,14 +383,14 @@
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/D_Test1.java" />
<entry file="file://$PROJECT_DIR$/Info Datei Nur für Alpha">
<entry file="file://$PROJECT_DIR$/src/D_Test2.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="143">
<caret line="33" column="20" selection-start-line="33" selection-start-column="20" selection-end-line="33" selection-end-column="20" />
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/D_Test2.java">
<entry file="file://$PROJECT_DIR$/src/D_Test3.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
@ -362,36 +398,32 @@
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/D_Geburtstag.java" />
<entry file="file://$PROJECT_DIR$/src/Quiz_E.java">
<entry file="file://$PROJECT_DIR$/src/Quiz.java" />
<entry file="file://$PROJECT_DIR$/src/RadioQuestion.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="37" selection-start-line="37" selection-end-line="38" selection-end-column="45" />
<state relative-caret-position="-1413">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="473">
<caret line="99" column="1" selection-start-line="99" selection-start-column="1" selection-end-line="99" selection-end-column="1" />
<state relative-caret-position="610">
<caret line="97" selection-start-line="97" selection-end-line="97" />
<folding>
<element signature="e#1760#1761#0" expanded="true" />
<element signature="e#1813#1814#0" expanded="true" />
<element signature="e#1938#1939#0" expanded="true" />
<element signature="e#1993#1994#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Tage_D.java">
<entry file="file://$PROJECT_DIR$/src/Quiz.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391">
<caret line="54" column="44" lean-forward="true" selection-start-line="54" selection-start-column="44" selection-end-line="54" selection-end-column="44" />
<state relative-caret-position="204">
<caret line="105" column="40" selection-start-line="105" selection-start-column="40" selection-end-line="105" selection-end-column="40" />
<folding>
<element signature="e#2655#2656#0" expanded="true" />
<element signature="e#3183#3184#0" expanded="true" />
<element signature="e#3238#3239#0" expanded="true" />
<element signature="e#3364#3365#0" expanded="true" />
<element signature="e#3419#3420#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>

BIN
out/production/Alpha/Main.class

BIN
out/production/Alpha/Quiz_E.class

140
src/Quiz.java

@ -0,0 +1,140 @@
import javax.swing.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.util.Random;
import javax.swing.JOptionPane;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Quiz extends JFrame {
JFrame fr = null;
JPanel contentPane = null;
JButton button1 = null;
JTextField j1 = null;
JLabel label1 = null;
JLabel label2 = null;
JLabel label3 = null;
JLabel frage1 = null;
JLabel frage1antworten = null;
JMenuItem menuItem1 = null;
JMenuItem menuItem2 = null;
JMenuBar bar =null;
JMenu mF= null;
JMenu mH = null;
int button1warsovielmalgedrückt = 0;
public Quiz() {
this.fr = new JFrame("GUI");
this.fr.setSize(430, 630);
this.contentPane = new JPanel();
this.fr.setContentPane(this.contentPane);
this.bar = new JMenuBar();
this.fr.setJMenuBar(bar);
this.mF = new JMenu("File");
this.mH = new JMenu("Help");
this.bar.add(mF);
this.bar.add(mH);
this.menuItem1 = new JMenuItem("Exit");
this.mF.add(menuItem1);
this.menuItem1.addActionListener(new CloseListener());
this.menuItem2 = new JMenuItem("Info");
this.mH.add(menuItem2);
this.menuItem2.addActionListener(new CloseListener3());
this.label1 = new JLabel("Herzlich willkommen zu unserem Quiz!");
this.contentPane.add(label1);
this.label2 = new JLabel("Beantworten Sie uns 5 kurze Fragen und gewinnen Sie 10000 Euro!");
this.contentPane.add(label2);
this.frage1 = new JLabel("Frage 1 lautet: Was gehört nicht zum Test Driven Developement?");
this.contentPane.add(frage1);
this.frage1antworten = new JLabel("A : Refactoring B : Transformation C : Clean Code D : Neuer Test ");
this.contentPane.add(frage1antworten);
this.label3 = new JLabel("Antwort:");
this.contentPane.add(label3);
this.j1 = new JTextField("", 20);
this.contentPane.add(j1);
this.j1.setSize(250,30);;
this.button1 = new JButton("Prüfen");
this.contentPane.add(button1);
this.button1.addActionListener(new CloseListener2());
this.fr.setVisible(true);
}
public static void main(String[] args) {
Quiz g = new Quiz();
}
private class CloseListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}
public class CloseListener2 implements ActionListener{
@Override
public void actionPerformed(ActionEvent a) {
button1warsovielmalgedrückt++;
if(j1.getText().startsWith("C") || j1.getText().startsWith("c") ) {
System.out.println("ja");
j1.setText("Richtig ! Gewinn 1000 Euro");
button1warsovielmalgedrückt++;
}else{
System.out.println("nein");
j1.setText("Falsch geantwortet! ");
}
}
}
public class CloseListener3 implements ActionListener{
@Override
public void actionPerformed(ActionEvent a) {
System.out.println("Hier sollen Sie Info bekommen");
}
}
}

107
src/Quiz_E.java

@ -1,107 +0,0 @@
import java.awt.JobAttributes;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;
import javax.swing.*;
public class Quiz_E {
JFrame fr = null;
JPanel contentPane = null;
JButton button1 = null;
JLabel label1 = null;
JLabel label2 = null;
JLabel label3 = null;
JLabel label4 = null;
JLabel label5 = null;
JLabel label6 = null;
JLabel label7 = null;
JTextField j1 = null;
JTextField j2 = null;
JTextField j3 = null;
JTextField j4 = null;
JMenuItem menuItem1 = null;
JMenuItem menuItem2 = null;
JOptionPane opane = null;
JMenuBar bar =null;
JMenu mF= null;
JMenu mH = null;
int button1warsovielmalgedrückt = 0;
public Quiz_E() {
this.fr = new JFrame("GUI");
this.fr.setSize(300, 900);
this.contentPane = new JPanel();
this.fr.setContentPane(this.contentPane);
this.bar = new JMenuBar();
this.fr.setJMenuBar(bar);
this.mF = new JMenu("File");
this.mH = new JMenu("Help");
this.bar.add(mF);
this.bar.add(mH);
this.menuItem1 = new JMenuItem("Exit");
this.mF.add(menuItem1);
this.menuItem2 = new JMenuItem("Info");
this.mH.add(menuItem2);
this.label4= new JLabel("Das spiel wird ihr Leben verändern.");
this.contentPane.add(label4);
this.label5= new JLabel("Wollen Sie erfahren, Wie viel Zeit bleibt dir in deinem Leben noch?");
this.contentPane.add(label5);
this.label1 = new JLabel("Wie ist Ihr Name?");
this.contentPane.add(label1);
this.j1 = new JTextField("", 20);
this.contentPane.add(j1);
this.j1.setSize(160,20);;
this.label2 = new JLabel("Wie alt sind Sie?");
this.contentPane.add(label2);
this.j2 = new JTextField("", 20);
this.contentPane.add(j2);
this.j2.setSize(160,20);
this.label3 = new JLabel("Was machen Sie beruflich?");
this.contentPane.add(label3);
this.j3 = new JTextField("", 20);
this.contentPane.add(j3);
this.button1 = new JButton("Erfahren");
this.contentPane.add(button1);
this.j4 = new JTextField("Sie sterben in ___ Jahren!");
this.contentPane.add(j4);
this.label6 = new JLabel("Die Wahrheit ist schwer zu ertragen.");
this.contentPane.add(label6);
this.label7 = new JLabel("ich hab eine Lösung für dich!");
this.contentPane.add(label7);
this.fr.setVisible(true);
}
public static void main(String[] args) {
Quiz_E q = new Quiz_E();
}
}
Loading…
Cancel
Save