Hallo
Ich habe ein Problem mit meiner Kontoverwaltung und hoffe ihr könnt mir weiter helfen
Und zwar habe ich schon folgenden Java code programmiert
Nun möchte ich mir meine erstellten Konten mit dem Befehl anzeigen lassen, doch leider klappt dies nicht =(
Ich hoffe ihr versteht mein Problem und könnt mir helfen
Ich habe ein Problem mit meiner Kontoverwaltung und hoffe ihr könnt mir weiter helfen
Und zwar habe ich schon folgenden Java code programmiert
Java:
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args)
{
// Variabeln definieren
String[] Kontoname = new String[20];
int[] Kontonummer = new int[20];
int[] Kontobestand = new int[20];
Object[] options = {"Konto anlegen", "Abbrechen"};
int auswahl1 = JOptionPane.showOptionDialog(null,
"Treffen Sie eine Auswahl",
"Überischt",
JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null, options, options[0]);
System.out.println(auswahl1);
switch(auswahl1){
case 0:
for(int i=0; i<5; i++)
{
Kontoname[i] = JOptionPane.showInputDialog(null,"Name des Kontoinhabers",
"Kontoverwaltung",
JOptionPane.PLAIN_MESSAGE);
System.out.println(Kontoname[i]);
Kontonummer[i] = Integer.valueOf(JOptionPane.showInputDialog(null,"Kontonummer des Kontoinhabers",
"Kontoverwaltung",
JOptionPane.PLAIN_MESSAGE));
System.out.println(Kontonummer[i]);
Kontobestand[i] = Integer.valueOf(JOptionPane.showInputDialog(null,"Kontobestand des Kontoinhabers",
"Kontoverwaltung",
JOptionPane.PLAIN_MESSAGE));
System.out.println(Kontobestand[i]);
}
break;
case 1:
JOptionPane.showMessageDialog(null,
"Kontoverwaltung wurde abgebrochen",
"Abbruch",
JOptionPane.WARNING_MESSAGE);
}
Object[] options2 = {"Konten anlegen", "Konto löschen" , "Einzahlen" , "Auszahlen" , "Abbrechen"};
int auswahl2 = JOptionPane.showOptionDialog(null,
"Inhaber: " + Kontoname[i]+" KtoNr. : "+ Kontonummer[i] + " Ktobst. : " + Kontobestand[i] +"\n" ,
"Kontoverwaltung" ,
JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null, options2, options[0]);
System.out.println(auswahl2);
switch(auswahl2){
case 0:
for(int i=; i<6; i++)
{ Kontoname[i] = JOptionPane.showInputDialog(null,"Name des Kontoinhabers",
"Kontoverwaltung",
JOptionPane.PLAIN_MESSAGE);
System.out.println(Kontoname[i]);
Kontonummer[i] = Integer.valueOf(JOptionPane.showInputDialog(null,"Kontonummer des Kontoinhabers",
"Kontoverwaltung",
JOptionPane.PLAIN_MESSAGE));
System.out.println(Kontonummer[i]);
Kontobestand[i] = Integer.valueOf(JOptionPane.showInputDialog(null,"Kontobestand des Kontoinhabers",
"Kontoverwaltung",
JOptionPane.PLAIN_MESSAGE));
System.out.println(Kontobestand[i]);
}
break;
case 1:
System.out.println("i ist eins");
break;
case 2:
System.out.println("i ist zwei");
break;
case 3:
System.out.println("i ist drei");
break;
case 4:
JOptionPane.showMessageDialog(null,
"Kontoverwaltung wurde abgebrochen",
"Abbruch",
JOptionPane.WARNING_MESSAGE);
}
}
}
Nun möchte ich mir meine erstellten Konten mit dem Befehl anzeigen lassen, doch leider klappt dies nicht =(
Java:
nt auswahl2 = JOptionPane.showOptionDialog(null,
"Inhaber: " + Kontoname[i]+" KtoNr. : "+ Kontonummer[i] + " Ktobst. : " + Kontobestand[i] +"\n" ,
"Kontoverwaltung" ,
JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null, options2, options[0]);
Ich hoffe ihr versteht mein Problem und könnt mir helfen