2020 */
2121package de .bielefeld .umweltamt .aui .gui ;
2222
23- import java .awt .Dimension ;
2423import java .awt .HeadlessException ;
2524import java .util .Arrays ;
2625
2726import javax .swing .JComponent ;
28- import javax .swing .JLabel ;
2927import javax .swing .JOptionPane ;
30- import javax .swing .JPanel ;
3128import javax .swing .JPasswordField ;
3229
33- import com .jgoodies .forms .builder .PanelBuilder ;
34- import com .jgoodies .forms .factories .Paddings ;
35- import com .jgoodies .forms .layout .CellConstraints ;
36- import com .jgoodies .forms .layout .FormLayout ;
37-
3830import org .hibernate .HibernateException ;
3931import org .hibernate .Session ;
4032import org .hibernate .Transaction ;
4133import org .hibernate .query .NativeQuery ;
42- import org .jfree .ui .tabbedui .VerticalLayout ;
4334
4435import de .bielefeld .umweltamt .aui .HauptFrame ;
4536import de .bielefeld .umweltamt .aui .HibernateSessionFactory ;
@@ -54,10 +45,6 @@ public class PasswordChangeDialog extends OkCancelDialog {
5445 /** Logging */
5546 private static final AuikLogger log = AuikLogger .getLogger ();
5647
57- private JLabel currentPasswordLabel ;
58- private JLabel newPasswordLabel ;
59- private JLabel newPasswordConfirmLabel ;
60-
6148 private JPasswordField currentPasswordField ;
6249 private JPasswordField newPasswordField ;
6350 private JPasswordField newPasswordConfirmField ;
@@ -74,38 +61,18 @@ public PasswordChangeDialog(HauptFrame owner){
7461
7562 @ Override
7663 protected JComponent buildContentArea () {
77- currentPasswordLabel = new JLabel ("Aktuelles Passwort:" );
78- newPasswordLabel = new JLabel ("Neues Passwort:" );
79- newPasswordConfirmLabel = new JLabel ("Passwort bestätigen:" );
80- currentPasswordField = new JPasswordField ();
81- newPasswordField = new JPasswordField ();
82- newPasswordConfirmField = new JPasswordField ();
83-
84- currentPasswordField .setPreferredSize (new Dimension (150 , 22 ));
64+ final int nColumns = 24 ;
65+ currentPasswordField = new JPasswordField (nColumns );
66+ newPasswordField = new JPasswordField (nColumns );
67+ newPasswordConfirmField = new JPasswordField (nColumns );
8568
8669 //Create form
87- FormLayout layout = new FormLayout (
88- "right:pref, 4dlu, pref:grow, 4dlu, pref" , // Spalten
89- "pref:grow, 3dlu, pref, 3dlu, pref, 3dlu, p" // Zeilen
90- );
91-
92- JPanel contentPanel = new JPanel (new VerticalLayout ());
93-
94- layout .setRowGroups (new int [][]{{1 , 3 , 5 }});
95-
96- PanelBuilder builder = new PanelBuilder (layout );
97- CellConstraints cc = new CellConstraints ();
98- builder .add (currentPasswordLabel , cc .xy (1 , 1 ));
99- builder .add (currentPasswordField , cc .xy (3 , 1 ));
100- builder .add (newPasswordLabel , cc .xy (1 , 3 ));
101- builder .add (newPasswordField , cc .xy (3 , 3 ));
102- builder .add (newPasswordConfirmLabel , cc .xy (1 , 5 ));
103- builder .add (newPasswordConfirmField , cc .xy (3 , 5 ));
104- JPanel formPanel = builder .getPanel ();
105- formPanel .setBorder (Paddings .DIALOG );
106- contentPanel .add (formPanel );
107-
108- return contentPanel ;
70+ Form formPanel = new Form ();
71+ formPanel .appendField ("Aktuelles Passwort:" , currentPasswordField );
72+ formPanel .appendField ("Neues Passwort:" , newPasswordField );
73+ formPanel .appendField ("Passwort bestätigen:" , newPasswordConfirmField );
74+
75+ return formPanel ;
10976 }
11077
11178 /**
0 commit comments