Browse Source

jAVA Goooooggle Style importiert und angewendet

new_repo
Komlovski 5 years ago
parent
commit
05ffd28219
  1. 5
      .idea/codeStyles/codeStyleConfig.xml
  2. 6
      .idea/google-java-format.xml
  3. 2
      .idea/misc.xml
  4. 108
      .idea/workspace.xml
  5. 2
      src/Main.java
  6. 13
      src/Quiz.form
  7. 164
      src/Quiz.java

5
.idea/codeStyles/codeStyleConfig.xml

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="GoogleStyle copy" />
</state>
</component>

6
.idea/google-java-format.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GoogleJavaFormatSettings">
<option name="enabled" value="true" />
</component>
</project>

2
.idea/misc.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

108
.idea/workspace.xml

@ -2,9 +2,12 @@
<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 afterPath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" 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$/.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/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" />
<change beforePath="$PROJECT_DIR$/src/Quiz.form" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/Quiz.java" beforeDir="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" />
@ -19,14 +22,24 @@
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="true"> <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="34">
<caret line="39" column="21" lean-forward="true" selection-start-line="39" selection-start-column="21" selection-end-line="39" selection-end-column="21" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Main.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="76">
<caret line="23" column="30" selection-start-line="23" selection-start-column="30" selection-end-line="23" selection-end-column="30" />
<state relative-caret-position="195">
<caret line="131" column="20" selection-start-line="131" selection-start-column="20" selection-end-line="131" selection-end-column="46" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#1860#1993#0" expanded="true" />
<element signature="e#1992#1993#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -35,12 +48,10 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Tage_D.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="100">
<caret line="35" column="8" lean-forward="true" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="30" />
<state relative-caret-position="-1688">
<caret line="35" column="8" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="30" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#1920#2053#0" expanded="true" />
<element signature="e#2052#2053#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -93,9 +104,9 @@
</option> </option>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="793" />
<option name="width" value="814" />
<option name="height" value="877" />
<option name="x" value="-7" />
<option name="width" value="974" />
<option name="height" value="1057" />
</component> </component>
<component name="ProjectLevelVcsManager"> <component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" /> <ConfirmationsSetting value="2" id="Add" />
@ -105,6 +116,7 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@ -126,7 +138,6 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
<pane id="PackagesPane" /> <pane id="PackagesPane" />
</panes> </panes>
</component> </component>
@ -142,7 +153,7 @@
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
<property name="restartRequiresConfirmation" value="false" /> <property name="restartRequiresConfirmation" value="false" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CreateTestDialog.RecentsKey"> <key name="CreateTestDialog.RecentsKey">
@ -386,24 +397,24 @@
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="41140000" />
<option name="totallyTimeSpent" value="42203000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1616" height="886" extended-state="6" />
<frame x="-8" y="-8" width="1382" height="784" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.14588688" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.22012103" />
<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" />
<window_info id="UI Designer" order="4" /> <window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" /> <window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" /> <window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Messages" order="0" weight="0.32802126" />
<window_info anchor="bottom" id="Messages" order="0" sideWeight="0.49848714" weight="0.32718894" />
<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 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 active="true" anchor="bottom" id="Run" order="3" sideWeight="0.49924356" visible="true" weight="0.33333334" />
<window_info anchor="bottom" id="Debug" order="4" sideWeight="0.49924356" weight="0.39938557" />
<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" />
<window_info anchor="bottom" id="TODO" order="7" /> <window_info anchor="bottom" id="TODO" order="7" />
@ -411,7 +422,7 @@
<window_info anchor="bottom" id="Version Control" order="9" weight="0.32802126" /> <window_info anchor="bottom" id="Version Control" order="9" weight="0.32802126" />
<window_info anchor="bottom" id="Database Changes" order="10" /> <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="Terminal" order="11" weight="0.3290461" />
<window_info anchor="bottom" id="Event Log" order="12" side_tool="true" />
<window_info anchor="bottom" id="Event Log" order="12" sideWeight="0.50075644" side_tool="true" weight="0.33333334" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <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" 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" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@ -474,59 +485,48 @@
<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/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/Quiz.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<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" />
<state relative-caret-position="-2320">
<caret line="11" column="13" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
<folding> <folding>
<element signature="e#24496#24497#0" expanded="true" />
<element signature="e#24553#24554#0" expanded="true" />
<element signature="imports" 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" />
<entry file="file://$PROJECT_DIR$/src/bild.gif" />
<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/Tage_D.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<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 relative-caret-position="-1688">
<caret line="35" column="8" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="30" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/Tage_D.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="100">
<caret line="35" column="8" lean-forward="true" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="30" />
<state relative-caret-position="195">
<caret line="131" column="20" selection-start-line="131" selection-start-column="20" selection-end-line="131" selection-end-column="46" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#1920#2053#0" expanded="true" />
<element signature="e#2052#2053#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/Quiz_Spiel.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="23" column="30" selection-start-line="23" selection-start-column="30" selection-end-line="23" selection-end-column="30" />
<state relative-caret-position="34">
<caret line="39" column="21" lean-forward="true" selection-start-line="39" selection-start-column="21" selection-end-line="39" selection-end-column="21" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#1860#1993#0" expanded="true" />
<element signature="e#1992#1993#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>

2
src/Main.java

@ -129,7 +129,7 @@ public class Main {
JOptionPane.showMessageDialog(fr, "Aufruf von Michaels Tools"); JOptionPane.showMessageDialog(fr, "Aufruf von Michaels Tools");
fr.setVisible(false); fr.setVisible(false);
Quiz qwqqq = new Quiz();
//Quiz qwqqq = new Quiz();
}catch (Exception ex) { }catch (Exception ex) {

13
src/Quiz.form

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Quiz">
<grid id="27dc6" row-count="1" column-count="1" layout-manager="GridLayoutManager">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</form>

164
src/Quiz.java

@ -1,164 +0,0 @@
import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
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 frage1antworten1 = null;
JLabel frage2 = null;
JLabel frage1antworten2 = null;
JLabel html1 = 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.label1.setForeground(Color.BLUE );
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.frage1antworten1 = new JLabel("A: Refactoring B: Transformation C: Clean Code");
this.contentPane.add(frage1antworten1);
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");
JOptionPane.showMessageDialog(null,
"Herzlichen Glückwunsch , Sie sind nicht so dumm, wie ich dachte !",
"Eine Nachricht",
JOptionPane.WARNING_MESSAGE);
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");
}
}
}
Loading…
Cancel
Save