implemented the change details panel to show former details excpet password

gui
David Groys 2024-06-16 15:26:34 +02:00
parent 991e0f1d8d
commit 5ce975c334
1 changed files with 34 additions and 16 deletions

View File

@ -762,6 +762,24 @@ public class Main extends JFrame {
changeDetailsButton.addActionListener(new ActionListener() { changeDetailsButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String[] details = facade.getDetails();
JTextField detailsText = findTextFieldByName(changeName, "changeNameText");
detailsText.setText(details[0]);
detailsText = findTextFieldByName(changeOrt, "changeOrtText");
detailsText.setText(details[1]);
detailsText = findTextFieldByName(changePLZ, "changePLZText");
detailsText.setText(details[2]);
detailsText = findTextFieldByName(changeCarName, "changeCarNameText");
detailsText.setText(details[3]);
detailsText = findTextFieldByName(changeCarCO2, "changeCarCO2Text");
detailsText.setText(details[4]);
detailsText = findTextFieldByName(changeCarSpeed, "changeCarSpeedText");
detailsText.setText(details[5]);
detailsText = findTextFieldByName(changeBikeSpeed, "changeBikeSpeedText");
detailsText.setText(details[6]);
detailsText = findTextFieldByName(checkChangePassword, "checkChangePasswordText");
detailsText.setText("");
cardLayout.show(panelLayout, "5"); cardLayout.show(panelLayout, "5");
jframe.setSize(new Dimension(260, 394)); jframe.setSize(new Dimension(260, 394));
} }
@ -869,22 +887,6 @@ public class Main extends JFrame {
else{ else{
errorMessageCreate(); errorMessageCreate();
} }
JTextField clear = findTextFieldByName(changeName, "changeNameText");
clear.setText("");
clear = findTextFieldByName(checkChangePassword, "checkChangePasswordText");
clear.setText("");
clear = findTextFieldByName(changeOrt, "changeOrtText");
clear.setText("");
clear = findTextFieldByName(changePLZ, "changePLZText");
clear.setText("");
clear = findTextFieldByName(changeCarName, "changeCarNameText");
clear.setText("");
clear = findTextFieldByName(changeCarCO2, "changeCarCO2Text");
clear.setText("");
clear = findTextFieldByName(changeCarSpeed, "changeCarSpeedText");
clear.setText("");
clear = findTextFieldByName(changeBikeSpeed, "changeBikeSpeedText");
clear.setText("");
} }
}); });
} }
@ -995,6 +997,22 @@ public class Main extends JFrame {
jframe.setSize(new Dimension(450, 160)); jframe.setSize(new Dimension(450, 160));
JTextField clear = findTextFieldByName(searchPLZ_ORT, "ortSuche"); JTextField clear = findTextFieldByName(searchPLZ_ORT, "ortSuche");
clear.setText(""); clear.setText("");
clear = findTextFieldByName(changeName, "changeNameText");
clear.setText("");
clear = findTextFieldByName(checkChangePassword, "checkChangePasswordText");
clear.setText("");
clear = findTextFieldByName(changeOrt, "changeOrtText");
clear.setText("");
clear = findTextFieldByName(changePLZ, "changePLZText");
clear.setText("");
clear = findTextFieldByName(changeCarName, "changeCarNameText");
clear.setText("");
clear = findTextFieldByName(changeCarCO2, "changeCarCO2Text");
clear.setText("");
clear = findTextFieldByName(changeCarSpeed, "changeCarSpeedText");
clear.setText("");
clear = findTextFieldByName(changeBikeSpeed, "changeBikeSpeedText");
clear.setText("");
} }
}); });
} }