Browse Source

Tage_D Zufallsgenerator erstellt.

new_repo
Hauch IT 5 years ago
parent
commit
848910f35d
  1. 2
      .idea/misc.xml
  2. 50
      .idea/workspace.xml
  3. 33
      src/Tage_D.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_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

50
.idea/workspace.xml

@ -2,8 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="41dc023d-0769-466f-850a-8e3eed9fe5fa" name="Default Changelist" comment="">
<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/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Tage_D.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Tage_D.java" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
@ -17,11 +17,11 @@
<option name="isMigrated" value="true" />
</component>
<component name="FileEditorManager">
<leaf>
<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="-26">
<state relative-caret-position="1207">
<caret line="75" column="82" selection-start-line="75" selection-start-column="82" selection-end-line="75" selection-end-column="82" />
<folding>
<element signature="imports" expanded="true" />
@ -33,8 +33,8 @@
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Tage_D.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="323">
<caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
<state relative-caret-position="85">
<caret line="101" lean-forward="true" selection-start-line="101" selection-end-line="101" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -120,12 +120,6 @@
<item name="Alpha" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Alpha" type="b2602c69:ProjectViewProjectNode" />
<item name="Alpha" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="Quiz_Spiel.java" type="529ef68f:ClassesTreeStructureProvider$PsiClassOwnerTreeNode" />
</path>
</expand>
<select />
</subPane>
@ -233,7 +227,8 @@
<workItem from="1562781684319" duration="923000" />
<workItem from="1562789348995" duration="2654000" />
<workItem from="1562848572975" duration="6651000" />
<workItem from="1562856644601" duration="8551000" />
<workItem from="1562856644601" duration="8772000" />
<workItem from="1562929796678" duration="3640000" />
</task>
<task id="LOCAL-00001" summary="neue master">
<created>1562341097724</created>
@ -368,17 +363,24 @@
<option name="project" value="LOCAL" />
<updated>1562864535253</updated>
</task>
<option name="localTasksCounter" value="20" />
<task id="LOCAL-00020" summary="Tage_D Zufallsgenerator erstellt.">
<created>1562866562782</created>
<option name="number" value="00020" />
<option name="presentableId" value="LOCAL-00020" />
<option name="project" value="LOCAL" />
<updated>1562866562782</updated>
</task>
<option name="localTasksCounter" value="21" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="31328000" />
<option name="totallyTimeSpent" value="35189000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1616" height="886" extended-state="6" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.14203085" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.14395887" />
<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" />
@ -424,7 +426,8 @@
<MESSAGE value="Main Menü angepasst mit Auswahl und Action Listener erstellt. So das Unterklassen Objekte erzeugt werden" />
<MESSAGE value="Entwicklung eines ButtonGroup Aktoren und der Verwendung der Klassen Quiz und Tage" />
<MESSAGE value="Verbesserung Main und Erweiterung Tage_D" />
<option name="LAST_COMMIT_MESSAGE" value="Verbesserung Main und Erweiterung Tage_D" />
<MESSAGE value="Tage_D Zufallsgenerator erstellt." />
<option name="LAST_COMMIT_MESSAGE" value="Tage_D Zufallsgenerator erstellt." />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/testJFrame.java" />
@ -476,12 +479,8 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/bild.jpg">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/src/bild.gif">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/src/bild.jpg" />
<entry file="file://$PROJECT_DIR$/src/bild.gif" />
<entry file="file://$PROJECT_DIR$/src/bild1.jpg">
<provider selected="true" editor-type-id="images" />
</entry>
@ -497,7 +496,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-26">
<state relative-caret-position="1207">
<caret line="75" column="82" selection-start-line="75" selection-start-column="82" selection-end-line="75" selection-end-column="82" />
<folding>
<element signature="imports" expanded="true" />
@ -507,8 +506,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/src/Tage_D.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="323">
<caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
<state relative-caret-position="85">
<caret line="101" lean-forward="true" selection-start-line="101" selection-end-line="101" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -570,7 +569,6 @@
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.6" />
</list>
</option>
</splitter-proportions>

33
src/Tage_D.java

@ -6,6 +6,7 @@ import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Random;
import java.util.Date;
public class Tage_D extends JFrame {
@ -30,6 +31,7 @@ public class Tage_D extends JFrame {
JMenu mF= null;
JMenu mH = null;
JMenu mI = null;
Date datum = null;
public Tage_D() {
@ -43,6 +45,9 @@ public class Tage_D extends JFrame {
fr.setContentPane(Panele);
Date datum=new Date();
int year=datum.getYear() + 1900;
bar = new JMenuBar();
fr.setJMenuBar(bar);
mF = new JMenu("File");
@ -100,9 +105,20 @@ public class Tage_D extends JFrame {
int zahl = Integer.parseInt(j3.getText());
int zufall = zahl + randomInt;
String resultat = new String("Sie werden im Jahr: "+zufall+" möglicherweise sterben!");
if(zufall<=year){
zufall = zahl + randomInt;
String resultat = new String("Sie werden in "+zufall+" Jahren möglicherweise sterben!");
j4.setText(resultat);
}else{
String resultat = new String("Sie werden in "+zufall+" Jahren möglicherweise sterben!");
j4.setText(resultat);
}
j4.setText(resultat);
}
});
@ -119,9 +135,18 @@ public class Tage_D extends JFrame {
int zahl = Integer.parseInt(j3.getText());
int zufall = zahl + randomInt;
String resultat = new String("Sie werden in "+zufall+" Jahren möglicherweise sterben!");
if(zufall<=year){
String resultat = new String("Sie werden in "+zufall+" Jahren möglicherweise sterben!");
j4.setText(resultat);
}else{
String resultat = new String("Test in "+zufall+" Jahren möglicherweise sterben!");
j4.setText(resultat);
}
j4.setText(resultat);
}
});

Loading…
Cancel
Save