From 5ce975c334777551066ee2231dbe8ba571b3a8c4 Mon Sep 17 00:00:00 2001 From: David Groys Date: Sun, 16 Jun 2024 15:26:34 +0200 Subject: [PATCH] implemented the change details panel to show former details excpet password --- src/main/java/de/hs_mannheim/ui/Main.java | 50 +++++++++++++++-------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/src/main/java/de/hs_mannheim/ui/Main.java b/src/main/java/de/hs_mannheim/ui/Main.java index 0d649e6..f3fcf03 100644 --- a/src/main/java/de/hs_mannheim/ui/Main.java +++ b/src/main/java/de/hs_mannheim/ui/Main.java @@ -762,6 +762,24 @@ public class Main extends JFrame { changeDetailsButton.addActionListener(new ActionListener() { @Override 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"); jframe.setSize(new Dimension(260, 394)); } @@ -869,22 +887,6 @@ public class Main extends JFrame { else{ 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)); JTextField clear = findTextFieldByName(searchPLZ_ORT, "ortSuche"); 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(""); } }); }