Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.idea/workspace.xml
new_repo
Komlovski 5 years ago
parent
commit
ab481e5227
  1. 116
      .idea/workspace.xml
  2. 6
      src/Main.java
  3. 62
      src/Tage_D.java

116
.idea/workspace.xml

@ -2,7 +2,9 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="41dc023d-0769-466f-850a-8e3eed9fe5fa" name="Default Changelist" comment=""> <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> </list>
<ignored path="$PROJECT_DIR$/out/" /> <ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -15,25 +17,26 @@
<option name="isMigrated" value="true" /> <option name="isMigrated" value="true" />
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<leaf>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Quiz.java">
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-51">
<caret line="9" selection-start-line="9" selection-end-line="10" selection-end-column="37" />
<state relative-caret-position="-26">
<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" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Quiz_Spiel.java">
<entry file="file://$PROJECT_DIR$/src/Tage_D.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="201" column="69" selection-start-line="201" selection-start-column="69" selection-end-line="201" selection-end-column="69" />
<state relative-caret-position="323">
<caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#5019#5020#0" expanded="true" />
<element signature="e#5065#5066#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -79,16 +82,16 @@
<option value="$PROJECT_DIR$/src/Geburtstag.java" /> <option value="$PROJECT_DIR$/src/Geburtstag.java" />
<option value="$PROJECT_DIR$/src/MainGUI.form" /> <option value="$PROJECT_DIR$/src/MainGUI.form" />
<option value="$PROJECT_DIR$/src/Tage_DTest.java" /> <option value="$PROJECT_DIR$/src/Tage_DTest.java" />
<option value="$PROJECT_DIR$/src/Tage_D.java" />
<option value="$PROJECT_DIR$/src/Quiz_Spiel.java" /> <option value="$PROJECT_DIR$/src/Quiz_Spiel.java" />
<option value="$PROJECT_DIR$/src/Main.java" /> <option value="$PROJECT_DIR$/src/Main.java" />
<option value="$PROJECT_DIR$/src/Tage_D.java" />
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="-7" />
<option name="width" value="974" />
<option name="height" value="1057" />
<option name="x" value="793" />
<option name="width" value="814" />
<option name="height" value="877" />
</component> </component>
<component name="ProjectLevelVcsManager"> <component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" /> <ConfirmationsSetting value="2" id="Add" />
@ -98,6 +101,8 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@ -125,8 +130,6 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
<pane id="PackagesPane" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -230,7 +233,7 @@
<workItem from="1562781684319" duration="923000" /> <workItem from="1562781684319" duration="923000" />
<workItem from="1562789348995" duration="2654000" /> <workItem from="1562789348995" duration="2654000" />
<workItem from="1562848572975" duration="6651000" /> <workItem from="1562848572975" duration="6651000" />
<workItem from="1562856644601" duration="6634000" />
<workItem from="1562856644601" duration="8551000" />
</task> </task>
<task id="LOCAL-00001" summary="neue master"> <task id="LOCAL-00001" summary="neue master">
<created>1562341097724</created> <created>1562341097724</created>
@ -358,17 +361,24 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1562861654490</updated> <updated>1562861654490</updated>
</task> </task>
<option name="localTasksCounter" value="19" />
<task id="LOCAL-00019" summary="Verbesserung Main und Erweiterung Tage_D">
<created>1562864535253</created>
<option name="number" value="00019" />
<option name="presentableId" value="LOCAL-00019" />
<option name="project" value="LOCAL" />
<updated>1562864535253</updated>
</task>
<option name="localTasksCounter" value="20" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="29445000" />
<option name="totallyTimeSpent" value="31328000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1382" height="784" extended-state="6" />
<frame x="-8" y="-8" width="1616" height="886" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.4977064" visible="true" weight="0.21406959" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.14203085" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" /> <window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" /> <window_info id="Designer" order="3" />
@ -378,7 +388,7 @@
<window_info anchor="bottom" id="Messages" order="0" weight="0.32802126" /> <window_info anchor="bottom" id="Messages" order="0" weight="0.32802126" />
<window_info anchor="bottom" id="Message" order="1" /> <window_info anchor="bottom" id="Message" order="1" />
<window_info anchor="bottom" id="Find" order="2" /> <window_info anchor="bottom" id="Find" order="2" />
<window_info anchor="bottom" id="Run" order="3" visible="true" weight="0.33026114" />
<window_info active="true" anchor="bottom" id="Run" order="3" visible="true" weight="0.33466136" />
<window_info anchor="bottom" id="Debug" order="4" weight="0.3997344" /> <window_info anchor="bottom" id="Debug" order="4" weight="0.3997344" />
<window_info anchor="bottom" id="Cvs" order="5" weight="0.25" /> <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="Inspection" order="6" weight="0.4" />
@ -413,7 +423,8 @@
<MESSAGE value="Junit für Tage_D erzeugt" /> <MESSAGE value="Junit für Tage_D erzeugt" />
<MESSAGE value="Main Menü angepasst mit Auswahl und Action Listener erstellt. So das Unterklassen Objekte erzeugt werden" /> <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="Entwicklung eines ButtonGroup Aktoren und der Verwendung der Klassen Quiz und Tage" />
<option name="LAST_COMMIT_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" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/testJFrame.java" /> <entry file="file://$PROJECT_DIR$/src/testJFrame.java" />
@ -447,44 +458,57 @@
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor" />
</entry> </entry>
<entry file="file://$PROJECT_DIR$/JunitTest/src/Tage_DTest.java" /> <entry file="file://$PROJECT_DIR$/JunitTest/src/Tage_DTest.java" />
<entry file="jar://C:/Program Files/Java/jdk1.8.0_111/src.zip!/javax/swing/JFrame.java" />
<entry file="jar://C:/Program Files/Java/jdk1.8.0_111/src.zip!/javax/swing/JRootPane.java" />
<entry file="file://$PROJECT_DIR$/src/bild.jpg" />
<entry file="file://$PROJECT_DIR$/src/bild.gif" />
<entry file="file://$PROJECT_DIR$/src/bild1.jpg" />
<entry file="file://$PROJECT_DIR$/src/bild2.jpg" />
<entry file="file://$PROJECT_DIR$/src/Tage_D.java">
<entry file="jar://C:/Program Files/Java/jdk1.8.0_111/src.zip!/javax/swing/JFrame.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="804">
<caret line="52" column="51" selection-start-line="52" selection-start-column="51" selection-end-line="52" selection-end-column="51" />
<state relative-caret-position="151">
<caret line="697" column="22" selection-start-line="697" selection-start-column="22" selection-end-line="697" selection-end-column="22" />
<folding> <folding>
<element signature="imports" expanded="true" />
<element signature="e#3538#3539#0" expanded="true" />
<element signature="e#3591#3592#0" expanded="true" />
<element signature="e#3716#3717#0" expanded="true" />
<element signature="e#3771#3772#0" expanded="true" />
<element signature="e#3897#3898#0" expanded="true" />
<element signature="e#3952#3953#0" expanded="true" />
<element signature="e#24496#24497#0" expanded="true" />
<element signature="e#24553#24554#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_111/src.zip!/javax/swing/JRootPane.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="814">
<caret line="620" column="18" selection-start-line="620" selection-start-column="18" selection-end-line="620" selection-end-column="18" />
</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/bild1.jpg">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/src/bild2.jpg">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/src/Quiz_Spiel.java"> <entry file="file://$PROJECT_DIR$/src/Quiz_Spiel.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="201" column="69" selection-start-line="201" selection-start-column="69" selection-end-line="201" selection-end-column="69" />
<state relative-caret-position="93">
<caret line="159" column="1" lean-forward="true" selection-start-line="159" selection-start-column="1" selection-end-line="163" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-26">
<caret line="75" column="82" selection-start-line="75" selection-start-column="82" selection-end-line="75" selection-end-column="82" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#5019#5020#0" expanded="true" />
<element signature="e#5065#5066#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/Main.java">
<entry file="file://$PROJECT_DIR$/src/Tage_D.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="105" column="34" selection-start-line="105" selection-start-column="34" selection-end-line="105" selection-end-column="34" />
<state relative-caret-position="323">
<caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>

6
src/Main.java

@ -67,13 +67,13 @@ public class Main {
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
JButton DTools = new JButton("Daniel"); DTools.setBounds(100, 100, 100, 20);
JButton DTools = new JButton("Daniel"); DTools.setBounds(100, 100, 100, 40);
buttonGroup.add(DTools); Panele.add(DTools); buttonGroup.add(DTools); Panele.add(DTools);
JButton ETools = new JButton("Eugen"); ETools.setBounds(200, 200, 100, 20);
JButton ETools = new JButton("Eugen"); ETools.setBounds(200, 200, 100, 40);
buttonGroup.add(ETools); Panele.add(ETools); buttonGroup.add(ETools); Panele.add(ETools);
JButton MTools = new JButton("Michael"); MTools.setBounds(300, 300, 100, 20);
JButton MTools = new JButton("Michael"); MTools.setBounds(300, 300, 100, 40);
buttonGroup.add(MTools); Panele.add(MTools); buttonGroup.add(MTools); Panele.add(MTools);
DTools.addActionListener(new ActionListener() { DTools.addActionListener(new ActionListener() {

62
src/Tage_D.java

@ -5,7 +5,7 @@ import javax.swing.JOptionPane;
import javax.swing.*; import javax.swing.*;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.util.concurrent.ThreadLocalRandom;
import java.util.Random;
public class Tage_D extends JFrame { public class Tage_D extends JFrame {
@ -20,6 +20,8 @@ public class Tage_D extends JFrame {
JTextField j2 = null; JTextField j2 = null;
JTextField j3 = null; JTextField j3 = null;
JTextField j4 = null; JTextField j4 = null;
JTextField j5 = null;
JTextField j6 = null;
JMenuItem menuItem1 = null; JMenuItem menuItem1 = null;
@ -33,7 +35,7 @@ public class Tage_D extends JFrame {
public Tage_D() { public Tage_D() {
fr = new JFrame("Coutinius Integration SS 2019"); fr = new JFrame("Coutinius Integration SS 2019");
fr.setSize(600,800);
fr.setSize(500,500);
fr.setFont(new Font("Helvetica", Font.PLAIN, 12)); fr.setFont(new Font("Helvetica", Font.PLAIN, 12));
fr.setLayout(new FlowLayout()); fr.setLayout(new FlowLayout());
@ -81,48 +83,54 @@ public class Tage_D extends JFrame {
*/ */
j1 = new JTextField("Tools von Daniel Hauch"); j1.setEditable(false); j1.setSize(450,30); ; Panele.add(j1); j1 = new JTextField("Tools von Daniel Hauch"); j1.setEditable(false); j1.setSize(450,30); ; Panele.add(j1);
j2 = new JTextField("Wie ist Ihr Name?"); j2.setEditable(false); Panele.add(j2); j2.setSize(450,30); Panele.add(j2);
j3 = new JTextField(""); j3.setEditable(true); Panele.add(j2); j3.setSize(450,30); Panele.add(j3);
button1 = new JButton("Erfahren"); Panele.add(button1);
j4 = new JTextField("Sie sterben in ___ Jahren!"); Panele.add(j4);
j2 = new JTextField("Geben Sie hier jeweils nach Auswahl: Geburtsjahr, Hohchzeitsjahr, aktuelles Jahr ein!"); j2.setEditable(false); Panele.add(j2); j2.setSize(450,30); Panele.add(j2);
j3 = new JTextField("Bsp. 1966"); j3.setEditable(true); Panele.add(j2); j3.setSize(450,30); Panele.add(j3);
j4 = new JTextField("Hier erfahren Sie Ergebnisse aus Ihrer Auswahl"); Panele.add(j4);
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
JButton szeit= new JButton("Sterbezeitpunkt");
JButton szeit= new JButton("Sterbezeitpunkt Erfahren");
szeit.setBounds(100, 170, 100, 20); szeit.setBounds(100, 170, 100, 20);
buttonGroup.add(szeit); Panele.add(szeit); buttonGroup.add(szeit); Panele.add(szeit);
JButton gtag = new JButton("zufällige Alter ausrechnen");
gtag.setBounds(250, 170, 100, 20);
buttonGroup.add(gtag); Panele.add(gtag);
JLabel auswahl = new JLabel("Ihre Auswahl:");
auswahl.setBounds(10, 200, 100, 20);
Panele.add(auswahl);
final JTextField text1 = new JTextField("");
text1.setBounds(100, 200, 300, 20);
Panele.add(text1);
szeit.addActionListener(new ActionListener() { szeit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ie) { public void actionPerformed(ActionEvent ie) {
text1.setText("MALE");
}
});
gtag.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ie) {
text1.setText("FEMALE");
Random randomGenerator = new Random();
int randomInt = randomGenerator.nextInt(50) + 1;
int zahl = Integer.parseInt(j3.getText());
int zufall = zahl + randomInt;
String resultat = new String("Sie werden im Jahr: "+zufall+" möglicherweise sterben!");
j4.setText(resultat);
} }
}); });
JButton gtag = new JButton("zufälliges Alter ausrechnen");
gtag.setBounds(250, 170, 100, 20);
buttonGroup.add(gtag); Panele.add(gtag);
gtag.addActionListener(new ActionListener() { gtag.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ie) { public void actionPerformed(ActionEvent ie) {
text1.setText("FEMALE");
Random randomGenerator = new Random();
int randomInt = randomGenerator.nextInt(50) + 1;
int zahl = Integer.parseInt(j3.getText());
int zufall = zahl + randomInt;
String resultat = new String("Sie werden in "+zufall+" Jahren möglicherweise sterben!");
j4.setText(resultat);
} }
}); });
final JTextField text1 = new JTextField("");
text1.setBounds(100, 200, 300, 20);
Panele.add(text1);
fr.setVisible(true); fr.setVisible(true);
fr.setAlwaysOnTop(true); fr.setAlwaysOnTop(true);
fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Loading…
Cancel
Save