Added GarbageGUI
This commit is contained in:
parent
59e2bc107d
commit
804a88d08b
|
@ -4,6 +4,7 @@
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/DHBWTest/DHBWTest.iml" filepath="$PROJECT_DIR$/DHBWTest/DHBWTest.iml" />
|
<module fileurl="file://$PROJECT_DIR$/DHBWTest/DHBWTest.iml" filepath="$PROJECT_DIR$/DHBWTest/DHBWTest.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Fahrzeug/Fahrzeug.iml" filepath="$PROJECT_DIR$/Fahrzeug/Fahrzeug.iml" />
|
<module fileurl="file://$PROJECT_DIR$/Fahrzeug/Fahrzeug.iml" filepath="$PROJECT_DIR$/Fahrzeug/Fahrzeug.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/GarbageGUI/GarbageGUI.iml" filepath="$PROJECT_DIR$/GarbageGUI/GarbageGUI.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/Kapselung/Kapselung.iml" filepath="$PROJECT_DIR$/Kapselung/Kapselung.iml" />
|
<module fileurl="file://$PROJECT_DIR$/Kapselung/Kapselung.iml" filepath="$PROJECT_DIR$/Kapselung/Kapselung.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/ModifyStringArrayList/ModifyStringArrayList.iml" filepath="$PROJECT_DIR$/ModifyStringArrayList/ModifyStringArrayList.iml" />
|
<module fileurl="file://$PROJECT_DIR$/ModifyStringArrayList/ModifyStringArrayList.iml" filepath="$PROJECT_DIR$/ModifyStringArrayList/ModifyStringArrayList.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/PassValid/PassValid.iml" filepath="$PROJECT_DIR$/PassValid/PassValid.iml" />
|
<module fileurl="file://$PROJECT_DIR$/PassValid/PassValid.iml" filepath="$PROJECT_DIR$/PassValid/PassValid.iml" />
|
||||||
|
|
|
@ -4,30 +4,13 @@
|
||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="7992561a-5a42-4f2e-a81a-79d8a9c03d77" name="Changes" comment="more simple stuff">
|
<list default="true" id="7992561a-5a42-4f2e-a81a-79d8a9c03d77" name="Changes" comment="Tasks for 2023-05-22">
|
||||||
<change afterPath="$PROJECT_DIR$/DHBWTest/.gitignore" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/GarbageGUI/.gitignore" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/DHBWTest/DHBWTest.iml" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/GarbageGUI/GarbageGUI.iml" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/DHBWTest/src/Main.java" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/GarbageGUI/src/GarbageGUI.java" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/Fahrzeug/.gitignore" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Fahrzeug/Fahrzeug.iml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Fahrzeug/src/Fahrrad.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Fahrzeug/src/Fahrzeug.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/ModifyStringArrayList/.gitignore" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/ModifyStringArrayList/ModifyStringArrayList.iml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/ModifyStringArrayList/src/ModifyStringArrayList.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/ModifyStringArrayList/src/ModifyStringArrayListMain.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Person/.gitignore" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Person/Person.iml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Person/src/Person.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Person/src/PersonMain.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/ThreadTask/.gitignore" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/ThreadTask/ThreadTask.iml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/ThreadTask/src/Main.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/density/.gitignore" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/density/density.iml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/density/src/Density.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.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$/density/src/Density.java" beforeDir="false" afterPath="$PROJECT_DIR$/density/src/Density.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -52,29 +35,30 @@
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent">{
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"ASKED_ADD_EXTERNAL_FILES": "true",
|
"ASKED_ADD_EXTERNAL_FILES": "true",
|
||||||
"ASKED_MARK_IGNORED_FILES_AS_EXCLUDED": "true",
|
"ASKED_MARK_IGNORED_FILES_AS_EXCLUDED": "true",
|
||||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"git-widget-placeholder": "master",
|
"full.screen.before.presentation.mode": "false",
|
||||||
"jdk.selected.JAVA_MODULE": "17",
|
"git-widget-placeholder": "master",
|
||||||
"jdk.selected.com.intellij.ui.dsl.builder.impl.RowImpl.sdk": "17",
|
"jdk.selected.JAVA_MODULE": "17",
|
||||||
"last_opened_file_path": "/home/plex/Documents/code/java/dhbw",
|
"jdk.selected.com.intellij.ui.dsl.builder.impl.RowImpl.sdk": "17",
|
||||||
"project.structure.last.edited": "Modules",
|
"last_opened_file_path": "/home/plex/Documents/code/java/dhbw",
|
||||||
"project.structure.proportion": "0.0",
|
"project.structure.last.edited": "Modules",
|
||||||
"project.structure.side.proportion": "0.0",
|
"project.structure.proportion": "0.0",
|
||||||
"settings.editor.selected.configurable": "preferences.lookFeel"
|
"project.structure.side.proportion": "0.0",
|
||||||
|
"settings.editor.selected.configurable": "preferences.lookFeel"
|
||||||
},
|
},
|
||||||
"keyToStringList": {
|
"keyToStringList": {
|
||||||
"jdk.preference.com.intellij.ui.dsl.builder.impl.RowImpl.sdk": [
|
"jdk.preference.com.intellij.ui.dsl.builder.impl.RowImpl.sdk": [
|
||||||
"17=/usr/lib/jvm/java-17"
|
"17=/usr/lib/jvm/java-17"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}</component>
|
}]]></component>
|
||||||
<component name="RunManager" selected="Application.Main">
|
<component name="RunManager" selected="Application.GarbageGUI">
|
||||||
<configuration name="Density" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
<configuration name="Density" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
<option name="MAIN_CLASS_NAME" value="Density" />
|
<option name="MAIN_CLASS_NAME" value="Density" />
|
||||||
<module name="density" />
|
<module name="density" />
|
||||||
|
@ -82,6 +66,13 @@
|
||||||
<option name="Make" enabled="true" />
|
<option name="Make" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<configuration name="GarbageGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
|
<option name="MAIN_CLASS_NAME" value="GarbageGUI" />
|
||||||
|
<module name="GarbageGUI" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
<option name="MAIN_CLASS_NAME" value="Main" />
|
<option name="MAIN_CLASS_NAME" value="Main" />
|
||||||
<module name="ThreadTask" />
|
<module name="ThreadTask" />
|
||||||
|
@ -96,13 +87,6 @@
|
||||||
<option name="Make" enabled="true" />
|
<option name="Make" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="PassValid" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
|
||||||
<option name="MAIN_CLASS_NAME" value="PassValid" />
|
|
||||||
<module name="PassValid" />
|
|
||||||
<method v="2">
|
|
||||||
<option name="Make" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
<configuration name="PersonMain" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
<configuration name="PersonMain" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
<option name="MAIN_CLASS_NAME" value="PersonMain" />
|
<option name="MAIN_CLASS_NAME" value="PersonMain" />
|
||||||
<module name="Person" />
|
<module name="Person" />
|
||||||
|
@ -112,11 +96,11 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<recent_temporary>
|
<recent_temporary>
|
||||||
<list>
|
<list>
|
||||||
|
<item itemvalue="Application.GarbageGUI" />
|
||||||
|
<item itemvalue="Application.Density" />
|
||||||
<item itemvalue="Application.Main" />
|
<item itemvalue="Application.Main" />
|
||||||
<item itemvalue="Application.PersonMain" />
|
<item itemvalue="Application.PersonMain" />
|
||||||
<item itemvalue="Application.ModifyStringArrayListMain" />
|
<item itemvalue="Application.ModifyStringArrayListMain" />
|
||||||
<item itemvalue="Application.Density" />
|
|
||||||
<item itemvalue="Application.PassValid" />
|
|
||||||
</list>
|
</list>
|
||||||
</recent_temporary>
|
</recent_temporary>
|
||||||
</component>
|
</component>
|
||||||
|
@ -178,7 +162,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1682344398810</updated>
|
<updated>1682344398810</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="8" />
|
<task id="LOCAL-00008" summary="Tasks for 2023-05-22">
|
||||||
|
<created>1684699543078</created>
|
||||||
|
<option name="number" value="00008" />
|
||||||
|
<option name="presentableId" value="LOCAL-00008" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1684699543078</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="9" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
@ -212,7 +203,8 @@
|
||||||
<MESSAGE value="schiffe overengineered" />
|
<MESSAGE value="schiffe overengineered" />
|
||||||
<MESSAGE value="del out dir" />
|
<MESSAGE value="del out dir" />
|
||||||
<MESSAGE value="more simple stuff" />
|
<MESSAGE value="more simple stuff" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="more simple stuff" />
|
<MESSAGE value="Tasks for 2023-05-22" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Tasks for 2023-05-22" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<breakpoint-manager>
|
<breakpoint-manager>
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
out/
|
||||||
|
!**/src/main/**/out/
|
||||||
|
!**/src/test/**/out/
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
bin/
|
||||||
|
!**/src/main/**/bin/
|
||||||
|
!**/src/test/**/bin/
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?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>
|
|
@ -0,0 +1,46 @@
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class GarbageGUI {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JFrame f=new JFrame("Amogus!");//creating instance of JFrame
|
||||||
|
|
||||||
|
JLabel l1=new JLabel("Input name:");
|
||||||
|
JLabel l2=new JLabel("Ergebnis: ");
|
||||||
|
JButton b=new JButton("Do thing");
|
||||||
|
|
||||||
|
JTextField tf = new JTextField("Name");
|
||||||
|
|
||||||
|
DefaultListModel<String> grets = new DefaultListModel<>();
|
||||||
|
grets.addElement("Hello");
|
||||||
|
grets.addElement("Moin");
|
||||||
|
grets.addElement("Linux Gruß");
|
||||||
|
JList gretList = new JList(grets);
|
||||||
|
l1.setBounds(50,0, 100,30);
|
||||||
|
l2.setBounds(50,400, 300,30);
|
||||||
|
tf.setBounds(150, 0, 200, 30);
|
||||||
|
b.setBounds(0, 0, 30, 30);
|
||||||
|
gretList.setBounds(50,50,400, 300);
|
||||||
|
|
||||||
|
b.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
String data = "";
|
||||||
|
if (gretList.getSelectedIndex() != -1) {
|
||||||
|
data = "Ergebnis: " + gretList.getSelectedValue() + ", " + tf.getText();
|
||||||
|
l2.setText(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
f.add(gretList);//adding button in JFrame
|
||||||
|
f.add(l1);
|
||||||
|
f.add(l2);
|
||||||
|
f.add(b);
|
||||||
|
f.add(tf);
|
||||||
|
f.setSize(500,500);//400 width and 500 height
|
||||||
|
f.setLayout(null);//using no layout managers
|
||||||
|
f.setVisible(true);//making the frame visible
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,7 +25,8 @@ public class Density {
|
||||||
}
|
}
|
||||||
System.out.println("input mass");
|
System.out.println("input mass");
|
||||||
int mass = scanner.nextInt();
|
int mass = scanner.nextInt();
|
||||||
// does not throw an division by 0 exception for float datatypes, instead says that density is 'Infinity'
|
// does not throw a division by 0 exception for float datatype,
|
||||||
|
// instead says that density is 'Infinity'
|
||||||
float density = (float) mass / volume;
|
float density = (float) mass / volume;
|
||||||
System.out.printf("density: %f%n", density);
|
System.out.printf("density: %f%n", density);
|
||||||
} catch (ArithmeticException e) {
|
} catch (ArithmeticException e) {
|
||||||
|
|
Loading…
Reference in New Issue