Compare commits

...

4 Commits

Author SHA1 Message Date
8d950c5704 Random to test Gitea PFP 2024-06-14 22:22:52 +02:00
Matti
cad9726d0d Size makes the Layout hurt my Eyes less 2024-06-07 14:33:44 +02:00
Matti
4c54ba5d4b Add tiny "i" Icon 2024-06-07 14:30:16 +02:00
Matti
1d523ed097 Add Correct Content 2024-06-07 14:25:11 +02:00
3 changed files with 68 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

View File

@ -7,9 +7,8 @@ public class Demo {
// w.display();
// }
aufg gudWindow = new aufg("Mein Geilo GUI", 700, 420);
gudWindow.loadDesign();
aufg gudWindow = new aufg("Mein Geniales GUI", 400, 340);
gudWindow.loadDesign2();
gudWindow.display(true);
}
}

View File

@ -31,14 +31,57 @@ public class aufg {
}
}
public void loadDesign2(){
addMenuBar();
addLabel("Von");
addLabeledTextField("Bahnhof/Haltestelle", false);
addImage("Medien/Bilder/info_I_tiny.png");
addLabel("Nach");
addLabeledTextField("Bahnhof/Haltestelle", false);
addButton("über");
addLabel("Hinfahrt");
addLabeledTextField("Datum", false);
addLabel("Rückfahrt");
addLabeledTextField("Uhrzeit", false);
// addDropdown(values = {"Abfahrt", "Ankunft"})
addLabeledTextField("Uhrzeit", false);
// addDropdown(values = {"Abfahrt", "Ankunft"})
addLabel("Angaben zur Preisberechnung");
addLabel("Reisende");
// addDropdown(values = {"1 Erwachsener", "1 Student"})
// addDropdown(values = {"Keine Ermäßigung", "20% Rabatt"})
// addDropDown(values = {"2. Klasse", "1. Klasse"})
addButton("Personen Hinzufügen");
addImage("Medien/Bilder/info_I_tiny.png");
addButton("Auslandspreise");
addImage("Medien/Bilder/info_I_tiny.png");
addLabel("Angaben zur Verbindung");
addLabel("Verkehrsmittel: ");
// addDropDown(values = {"Standartsuche", "Spezialsuche"})
addButton("Erweitert");
addImage("Medien/Bilder/info_I_tiny.png");
// addCheckBox(label = "schnelle Verbindung bevorzugen")
addImage("Medien/Bilder/info_I_tiny.png");
// addCheckBox(label = "Fahrradmitnahme")
addButton("Verbindung Suchen");
addButton("Neue Anfrage");
addButton("Mein Anfrageprofil");
}
public void loadDesign(){
addMenuBar();
addLabeledTextField("TextBox", true);
addLabeledPasswordField("Password", true);
addImage("Medien/Bilder/info_I.png");
addImage("Medien/Bilder/info_I_tiny.png");
addImage("Medien/Bilder/HackerUnicorn_Schäbig.png");
addLabeledRadioButtons("First Set of radiobuttons", new String[] {"Option1", "Choice2", "Variant3"}, true);
addLabeledRadioButtons("Second Group of Options", new String[] {"Maybe this?", "Or that"}, true);
// popUpInputText(new String[] {"Choice1", "Option2"});
popUpDropDown("Medien/Bilder/info_I_tiny.png",
"Title of my Window",
"choose your favourite",
new String[] {"Choice1", "Option2"},
"Option2");
}
public void addMenuBar(){
@ -162,6 +205,13 @@ public class aufg {
return b;
}
public void addButton(String text){
this.contentPane.add(makeButton(text));
}
public JButton makeButton(String text){
return new JButton(text);
}
public void addLabeledRadioButtons(String label, String[] options, boolean makeVertical){
this.contentPane.add(makeLabeledRadioButtons(label, options, makeVertical));
}
@ -178,4 +228,19 @@ public class aufg {
return b;
}
public String popUpInputText(String[] values){
return (String) JOptionPane.showInputDialog(this.contentPane, values);
}
public String popUpDropDown(String iconLink, String title, String message, String[] values, String initialSelection){
return (String) JOptionPane.showInputDialog(
this.contentPane,
message,
title,
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon(iconLink),
values,
initialSelection);
}
}