Browse Source

Gui fertig , Eingabe Ausgabe funktioniert.

new_repo
Komlovski 6 years ago
parent
commit
c07380944e
  1. 65
      .idea/workspace.xml
  2. 96
      src/Quiz_Spiel.java

65
.idea/workspace.xml

@ -3,7 +3,6 @@
<component name="ChangeListManager">
<list default="true" id="41dc023d-0769-466f-850a-8e3eed9fe5fa" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Quiz.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Quiz.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Quiz_Spiel.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Quiz_Spiel.java" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
@ -21,8 +20,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Quiz.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="86" column="90" lean-forward="true" selection-start-line="86" selection-start-column="90" selection-end-line="86" selection-end-column="90" />
<state relative-caret-position="-51">
<caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="10" selection-end-column="37" />
</state>
</provider>
</entry>
@ -30,8 +29,11 @@
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Quiz_Spiel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="170">
<caret line="93" column="31" lean-forward="true" selection-start-line="93" selection-start-column="31" selection-end-line="93" selection-end-column="31" />
<state relative-caret-position="163">
<caret line="207" column="69" selection-start-line="207" selection-start-column="69" selection-end-line="207" selection-end-column="69" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -223,7 +225,7 @@
<workItem from="1562781684319" duration="923000" />
<workItem from="1562789348995" duration="2654000" />
<workItem from="1562848572975" duration="3638000" />
<workItem from="1562855527862" duration="727000" />
<workItem from="1562855527862" duration="8587000" />
</task>
<task id="LOCAL-00001" summary="neue master">
<created>1562341097724</created>
@ -337,18 +339,32 @@
<option name="project" value="LOCAL" />
<updated>1562804715949</updated>
</task>
<option name="localTasksCounter" value="17" />
<task id="LOCAL-00017" summary="Funktion Prüfen Button Test">
<created>1562856294007</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1562856294007</updated>
</task>
<task id="LOCAL-00018" summary="Update">
<created>1562862100994</created>
<option name="number" value="00018" />
<option name="presentableId" value="LOCAL-00018" />
<option name="project" value="LOCAL" />
<updated>1562862100994</updated>
</task>
<option name="localTasksCounter" value="19" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="20491000" />
<option name="totallyTimeSpent" value="28351000" />
</component>
<component name="ToolWindowManager">
<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.21406959" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.4977064" visible="true" weight="0.21406959" />
<window_info id="Structure" order="1" sideWeight="0.5022936" side_tool="true" visible="true" weight="0.21406959" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
@ -390,21 +406,9 @@
<MESSAGE value="neue Tage Script" />
<MESSAGE value="neue GUI erstellt zum testen" />
<MESSAGE value="Junit für Tage_D erzeugt" />
<option name="LAST_COMMIT_MESSAGE" value="Junit für Tage_D erzeugt" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-method">
<url>file://$PROJECT_DIR$/src/Quiz.java</url>
<line>108</line>
<properties class="Quiz" method="main">
<option name="EMULATED" value="true" />
</properties>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
<MESSAGE value="Funktion Prüfen Button Test" />
<MESSAGE value="Update" />
<option name="LAST_COMMIT_MESSAGE" value="Update" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/testJFrame.java" />
@ -468,15 +472,18 @@
</entry>
<entry file="file://$PROJECT_DIR$/src/Quiz.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="86" column="90" lean-forward="true" selection-start-line="86" selection-start-column="90" selection-end-line="86" selection-end-column="90" />
<state relative-caret-position="-51">
<caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="10" selection-end-column="37" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Quiz_Spiel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="170">
<caret line="93" column="31" lean-forward="true" selection-start-line="93" selection-start-column="31" selection-end-line="93" selection-end-column="31" />
<state relative-caret-position="163">
<caret line="207" column="69" selection-start-line="207" selection-start-column="69" selection-end-line="207" selection-end-column="69" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>

96
src/Quiz_Spiel.java

@ -80,15 +80,15 @@ public class Quiz_Spiel extends JFrame {
sp_textarea_3 = new JScrollPane(textarea_3);
getContentPane().add(sp_textarea_3);
textarea_4 = new JTextArea("Was macht einen guten Test aus?");
textarea_4 = new JTextArea("Was macht git status?");
sp_textarea_4 = new JScrollPane(textarea_4);
getContentPane().add(sp_textarea_4);
textarea_5 = new JTextArea("textarea_5");
textarea_5 = new JTextArea("Welche Programmiersprache existiert nicht?");
sp_textarea_5 = new JScrollPane(textarea_5);
getContentPane().add(sp_textarea_5);
textarea_6 = new JTextArea("textarea_6");
textarea_6 = new JTextArea("Wie wird ein infizierter Programmcode bezeichnet?");
sp_textarea_6 = new JScrollPane(textarea_6);
getContentPane().add(sp_textarea_6);
@ -113,37 +113,40 @@ public class Quiz_Spiel extends JFrame {
getContentPane().add(button_2);
button_2.addActionListener(new CloseListener());
label_10 = new JLabel("A: Maintainable B: C: ");
label_10 = new JLabel("A: Senden B: Speichern C: Änderungen anzeigen ");
getContentPane().add(label_10);
textfield_7 = new JTextField("textfield_7");
textfield_7 = new JTextField("");
getContentPane().add(textfield_7);
button_3 = new JButton("Prüfen");
getContentPane().add(button_3);
button_3.addActionListener(new CloseListener1());
label_11 = new JLabel("label_11");
label_11 = new JLabel("A: C** B: C++ C: C# ");
getContentPane().add(label_11);
label_12 = new JLabel("label_12");
label_12 = new JLabel("A: Zecke B: Schlange C: Wurm");
getContentPane().add(label_12);
textfield_8 = new JTextField("textfield_8");
textfield_8 = new JTextField("");
getContentPane().add(textfield_8);
textfield_9 = new JTextField("textfield_9");
textfield_9 = new JTextField(""); //Hier
getContentPane().add(textfield_9);
button_4 = new JButton("Prüfen");
getContentPane().add(button_4);
button_4.addActionListener(new CloseListener3());
button_5 = new JButton("Prüfen");
getContentPane().add(button_5);
button_5.addActionListener(new CloseListener4());
textfield_10 = new JTextField("textfield_10");
getContentPane().add(textfield_10);
label_13 = new JLabel("label_13");
label_13 = new JLabel("Gewinn:");
getContentPane().add(label_13);
setSize(getPreferredSize());
@ -194,6 +197,79 @@ public class Quiz_Spiel extends JFrame {
}
class CloseListener4 implements ActionListener{
@Override
public void actionPerformed(ActionEvent a) {
if(textfield_9.getText().startsWith("C") || textfield_9.getText().startsWith("c") ) {
System.out.println("ja");
textfield_9.setText("Richtig ! Gewinn 1000 Euro");
JOptionPane.showMessageDialog(null,
"Herzlichen Glückwunsch, Sie haben 10000 Euro gewonnen!",
"Eine Nachricht",
JOptionPane.WARNING_MESSAGE);
}else{
System.out.println("nein");
textfield_9.setText("Falsch geantwortet! ");
}
}
}
class CloseListener3 implements ActionListener{
@Override
public void actionPerformed(ActionEvent a) {
if(textfield_8.getText().startsWith("A") || textfield_8.getText().startsWith("a") ) {
System.out.println("ja");
textfield_8.setText("Richtig ! Gewinn 1000 Euro");
JOptionPane.showMessageDialog(null,
"Gut gemacht, Egal wie leer du bist - es gibt Menschen die sind Lehrer!",
"Eine Nachricht",
JOptionPane.WARNING_MESSAGE);
}else{
System.out.println("nein");
textfield_8.setText("Falsch geantwortet! ");
}
}
}
class CloseListener1 implements ActionListener{
@Override
public void actionPerformed(ActionEvent a) {
if(textfield_7.getText().startsWith("C") || textfield_7.getText().startsWith("c") ) {
System.out.println("ja");
textfield_7.setText("Richtig ! Gewinn 1000 Euro");
JOptionPane.showMessageDialog(null,
"HA, gut geraten! Wo ist der beste Ort um eine Leiche zu verstecken? Seite 2 auf Google ",
"Eine Nachricht",
JOptionPane.WARNING_MESSAGE);
}else{
System.out.println("nein");
textfield_7.setText("Falsch geantwortet! ");
}
}
}
class CloseListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent a) {

Loading…
Cancel
Save