Add Correct Content
This commit is contained in:
parent
a64040170a
commit
1d523ed097
@ -7,8 +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", 700, 420);
|
||||
gudWindow.loadDesign2();
|
||||
gudWindow.display(true);
|
||||
|
||||
}
|
||||
|
@ -31,6 +31,43 @@ public class aufg {
|
||||
}
|
||||
}
|
||||
|
||||
public void loadDesign2(){
|
||||
addMenuBar();
|
||||
addLabel("Von");
|
||||
addLabeledTextField("Bahnhof/Haltestelle", false);
|
||||
addImage("Medien/Bilder/info_I.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.png");
|
||||
addButton("Auslandspreise");
|
||||
addImage("Medien/Bilder/info_I.png");
|
||||
addLabel("Angaben zur Verbindung");
|
||||
addLabel("Verkehrsmittel: ");
|
||||
// addDropDown(values = {"Standartsuche", "Spezialsuche"})
|
||||
addButton("Erweitert");
|
||||
addImage("Medien/Bilder/info_I.png");
|
||||
// addCheckBox(label = "schnelle Verbindung bevorzugen")
|
||||
addImage("Medien/Bilder/info_I.png");
|
||||
// addCheckBox(label = "Fahrradmitnahme")
|
||||
addButton("Verbindung Suchen");
|
||||
addButton("Neue Anfrage");
|
||||
addButton("Mein Anfrageprofil");
|
||||
}
|
||||
|
||||
public void loadDesign(){
|
||||
addMenuBar();
|
||||
addLabeledTextField("TextBox", true);
|
||||
@ -39,6 +76,12 @@ public class aufg {
|
||||
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.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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user