inital commit

This commit is contained in:
Paul 2020-10-18 21:50:38 +02:00
commit 9e03537284
32 changed files with 499 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelUserStore">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="com.jetbrains.rider.android.RiderAndroidMiscFileCreationComponent">
<option name="ENSURE_MISC_FILE_EXISTS" value="true" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.Kapitel1.1Aufgabe6.dir/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.Kapitel1.1Aufgabe6.dir/riderModule.iml" />
</modules>
</component>
</project>

View File

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

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="b49381fb-9b29-4874-b781-82528b829d09" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ProjectId" id="1Zf5FErDowh94lRoaYOR0ox166K" />
<component name="PropertiesComponent">
<property name="Rider.DefaultBreakpoints.AreToggled" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="b49381fb-9b29-4874-b781-82528b829d09" name="Default Changelist" comment="" />
<created>1585217202804</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1585217202804</updated>
<workItem from="1585217207211" duration="4000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="null" />
<component name="UnityUnitTestConfiguration" currentTestLauncher="NUnit" />
<component name="VcsManagerConfiguration">
<option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="true" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<breakpoint enabled="true" suspend="NONE" type="DotNet Exception Breakpoints">
<properties exception="System.Threading.ThreadAbortException" displayValue="System.Threading.ThreadAbortException" />
<option name="timeStamp" value="1" />
</breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelStore">
<e p="A:\Documents\TH\Datensicherheit (DC)\Kapitel1Aufgabe5" t="IncludeFlat" />
<e p="C:\Users\pogge\.Rider2019.2\system\extResources" t="IncludeRecursive" />
<e p="C:\Users\pogge\.Rider2019.2\system\resharper-host\local\Transient\ReSharperHost\v192\SolutionCaches\_.19.00" t="ExcludeRecursive" />
</component>
</project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelUserStore">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="com.jetbrains.rider.android.RiderAndroidMiscFileCreationComponent">
<option name="ENSURE_MISC_FILE_EXISTS" value="true" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.Kapitel1Aufgabe5.dir/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.Kapitel1Aufgabe5.dir/riderModule.iml" />
</modules>
</component>
</project>

View File

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

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="a7aef453-82d9-4e32-a82d-cb1130265bb9" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ProjectId" id="1Zf6CGDrp7fGELES3lQ37INa4dT" />
<component name="PropertiesComponent">
<property name="Rider.DefaultBreakpoints.AreToggled" value="true" />
<property name="Rider.ProjectViewActivator.IsNotFirstRun" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="a7aef453-82d9-4e32-a82d-cb1130265bb9" name="Default Changelist" comment="" />
<created>1585217672165</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1585217672165</updated>
<workItem from="1585217675202" duration="47000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="null" />
<component name="UnityUnitTestConfiguration" currentTestLauncher="NUnit" />
<component name="VcsManagerConfiguration">
<option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="true" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<breakpoint enabled="true" suspend="NONE" type="DotNet Exception Breakpoints">
<properties exception="System.Threading.ThreadAbortException" displayValue="System.Threading.ThreadAbortException" />
<option name="timeStamp" value="1" />
</breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,8 @@
<component name="ArtifactManager">
<artifact type="jar" name="Kapitel1Aufgabe5:jar">
<output-path>$PROJECT_DIR$/out/artifacts/Kapitel1Aufgabe5_jar</output-path>
<root id="archive" name="Kapitel1Aufgabe5.jar">
<element id="module-output" name="Kapitel1Aufgabe5" />
</root>
</artifact>
</component>

1
.idea/description.html generated Normal file
View File

@ -0,0 +1 @@
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>

6
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

9
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectKey">
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="14" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Kapitel1Aufgabe5.iml" filepath="$PROJECT_DIR$/Kapitel1Aufgabe5.iml" />
</modules>
</component>
</project>

3
.idea/project-template.xml generated Normal file
View File

@ -0,0 +1,3 @@
<template>
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
</template>

170
.idea/workspace.xml generated Normal file
View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="Kapitel1Aufgabe5:jar" />
</artifacts-to-build>
</component>
<component name="ChangeListManager">
<list default="true" id="9a4219db-306c-4d08-bc2a-ed1af73d5a3d" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ProjectId" id="1ZZN1xJmDfVUBzVpPFWkb57PHmG" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="Downloaded.Files.Path.Enabled" value="false" />
<property name="GenerateAntBuildDialog.backupFiles" value="true" />
<property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" />
<property name="GenerateAntBuildDialog.forceTargetJdk" value="true" />
<property name="GenerateAntBuildDialog.outputFileNameProperty" value="kapitel1.1aufgabe6" />
<property name="Repository.Attach.Annotations" value="false" />
<property name="Repository.Attach.JavaDocs" value="false" />
<property name="Repository.Attach.Sources" value="false" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="tech.loedige.Main" />
<module name="Kapitel1Aufgabe5" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="9a4219db-306c-4d08-bc2a-ed1af73d5a3d" name="Default Changelist" comment="" />
<created>1585042444915</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1585042444915</updated>
<workItem from="1585042448214" duration="5806000" />
<workItem from="1585133337716" duration="75000" />
<workItem from="1585133519589" duration="198000" />
<workItem from="1585215189930" duration="2042000" />
<workItem from="1585217432258" duration="124000" />
<workItem from="1585217745837" duration="836000" />
<workItem from="1585291255964" duration="641000" />
<workItem from="1586026502360" duration="43000" />
<workItem from="1587023043226" duration="658000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state x="2636" y="768" key="#com.intellij.ide.util.MemberChooser" timestamp="1585216865970">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="2636" y="768" key="#com.intellij.ide.util.MemberChooser/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585216865970" />
<state x="2561" y="843" key="#com.intellij.ide.util.TreeClassChooserDialog" timestamp="1585217969703">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="2561" y="843" key="#com.intellij.ide.util.TreeClassChooserDialog/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585217969703" />
<state width="3335" height="413" key="GridCell.Tab.0.bottom" timestamp="1585217244711">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state width="3335" height="413" key="GridCell.Tab.0.bottom/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585217244711" />
<state width="3335" height="413" key="GridCell.Tab.0.center" timestamp="1585217244711">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state width="3335" height="413" key="GridCell.Tab.0.center/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585217244711" />
<state width="3335" height="413" key="GridCell.Tab.0.left" timestamp="1585217244711">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state width="3335" height="413" key="GridCell.Tab.0.left/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585217244711" />
<state width="3335" height="413" key="GridCell.Tab.0.right" timestamp="1585217244711">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state width="3335" height="413" key="GridCell.Tab.0.right/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585217244711" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.bottom" timestamp="1585045272867">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.bottom/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272867" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.center" timestamp="1585045272867">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.center/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272867" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.left" timestamp="1585045272867">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.left/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272867" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.right" timestamp="1585045272867">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.1.right/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272867" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.bottom" timestamp="1585045272859">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.bottom/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272859" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.center" timestamp="1585045272858">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.center/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272858" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.left" timestamp="1585045272858">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.left/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272858" />
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.right" timestamp="1585045272858">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="768" height="432" key="GridCell.Tab.2.right/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045272858" />
<state x="2311" y="634" key="SettingsEditor" timestamp="1585217978910">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="2311" y="634" key="SettingsEditor/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585217978910" />
<state x="1447" y="545" key="com.intellij.ide.util.TipDialog" timestamp="1587023044125">
<screen x="62" y="0" width="3378" height="1440" />
</state>
<state x="2527" y="884" key="com.intellij.ide.util.TipDialog/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585291294941" />
<state x="1447" y="545" key="com.intellij.ide.util.TipDialog/62.0.3378.1440/-1018.-252.1018.1920/1109.-900.1378.900@62.0.3378.1440" timestamp="1587023044125" />
<state x="1447" y="545" key="com.intellij.ide.util.TipDialog/62.0.3378.1440/-1018.-348.1018.1920/1094.-768.1304.768@62.0.3378.1440" timestamp="1586026514574" />
<state x="2535" y="953" key="com.intellij.jarRepository.RepositoryAttachDialog-DOWNLOAD" timestamp="1585215353435">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="2535" y="953" key="com.intellij.jarRepository.RepositoryAttachDialog-DOWNLOAD/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585215353435" />
<state x="1670" y="1346" width="216" height="255" key="dock-window-1" timestamp="1585044122392">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1670" y="1346" width="216" height="255" key="dock-window-1/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585044122392" />
<state x="1258" y="605" width="784" height="507" key="dock-window-2" timestamp="1585044489127">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="784" height="507" key="dock-window-2/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585044489127" />
<state x="1258" y="605" width="784" height="497" key="dock-window-3" timestamp="1585045308114">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="1258" y="605" width="784" height="497" key="dock-window-3/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585045308114" />
<state x="1133" y="340" key="new project wizard" timestamp="1587023798624">
<screen x="62" y="0" width="3378" height="1440" />
</state>
<state x="1133" y="340" key="new project wizard/62.0.3378.1440/-1018.-252.1018.1920/1109.-900.1378.900@62.0.3378.1440" timestamp="1587023798624" />
<state x="2494" y="664" width="672" height="678" key="search.everywhere.popup" timestamp="1585215400420">
<screen x="1142" y="339" width="3378" height="1440" />
</state>
<state x="2494" y="664" width="672" height="678" key="search.everywhere.popup/1142.339.3378.1440/62.0.1018.1920@1142.339.3378.1440" timestamp="1585215400420" />
</component>
</project>

12
Kapitel1Aufgabe5.iml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

BIN
Kapitel1Aufgabe5.jar Normal file

Binary file not shown.

2
Readme.txt Normal file
View File

@ -0,0 +1,2 @@
Der Code wurde mit IntelliJ IDEA erstellt
Die .jar Datei öffnet eine graphische Ausgabe des Ergebnisses

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: tech.loedige.Main

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: tech.loedige.Main

3
src/META-INF/MANIFEST.MF Normal file
View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: tech.loedige.Main

View File

@ -0,0 +1,64 @@
package tech.loedige;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
public class Main {
public static void main(String[] args) {
// write your code here
char[][] code = generateCode();
outputCodeToConsole(code);
outputCodeToScreen(code);
}
private static void outputCodeToScreen(char[][] code) {
JFrame frame = new JFrame();
Container container = frame.getContentPane();
for(int i = 0; i<code[0].length;i++){
container.add(new JLabel((code[0][i]+" >> " + code[1][i])));
}
JButton rerunButton = new JButton("Neue Verschlüsselung");
rerunButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
frame.dispose();
outputCodeToScreen(generateCode());
}
});
container.add(rerunButton);
frame.setLayout(new BoxLayout(container, BoxLayout.PAGE_AXIS));
frame.pack();
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
Point centerPoint = graphicsEnvironment.getCenterPoint();
frame.setLocation(centerPoint.x/4, centerPoint.y/4);
frame.setVisible(true);
}
public static char[][] generateCode(){
char[][] code = new char[2][26];
code[0] = new char[]{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
code[1] = new char[]{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
Random rand = new Random();
for (int i = 0; i < code[1].length; i++) {
int randomIndexToSwap = rand.nextInt(code[1].length);
char temp = code[1][randomIndexToSwap];
code[1][randomIndexToSwap] = code[1][i];
code[1][i] = temp;
}
return code;
}
public static void outputCodeToConsole(char[][] code){
for(int r=0; r<code[0].length;r++){
System.out.println(code[0][r] + "\t->\t"+code[1][r]);
}
}
}