From: Christian G. [M. Mitch] <mas...@us...> - 2002-01-25 17:34:26
|
Update of /cvsroot/jprojecttimer/jprojecttimer/de/cgarbs/apps/jprojecttimer In directory usw-pr-cvs1:/tmp/cvs-serv4097/de/cgarbs/apps/jprojecttimer Modified Files: TaskEditDialog.java Log Message: Task 45748: added Cancel button to TaskListEdit dialog Index: TaskEditDialog.java =================================================================== RCS file: /cvsroot/jprojecttimer/jprojecttimer/de/cgarbs/apps/jprojecttimer/TaskEditDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TaskEditDialog.java 2002/01/20 13:09:34 1.2 --- TaskEditDialog.java 2002/01/25 17:34:22 1.3 *************** *** 38,41 **** --- 38,42 ---- final static String OK_BUTTON = "ok"; + final static String CANCEL_BUTTON = "cancel"; TaskEditDialog(JFrame owner, TaskList tasks, int index) *************** *** 136,147 **** // Buttons ! buildConstraints(constraints, 1, 4, 1, 1, 10, 40); constraints.fill = GridBagConstraints.NONE; ! constraints.anchor = GridBagConstraints.WEST; ! JButton b = new JButton(Resource.get("okButton")); ! b.setActionCommand(OK_BUTTON); ! b.addActionListener(this); ! gridbag.setConstraints(b, constraints); ! panel.add(b); return panel; --- 137,157 ---- // Buttons ! JPanel buttons = new JPanel(); ! ! JButton ok = new JButton(Resource.get("okButton")); ! ok.setActionCommand(OK_BUTTON); ! ok.addActionListener(this); ! buttons.add(ok); ! ! JButton cancel = new JButton(Resource.get("cancelButton")); ! cancel.setActionCommand(CANCEL_BUTTON); ! cancel.addActionListener(this); ! buttons.add(cancel); ! ! buildConstraints(constraints, 0, 4, 2, 1, 10, 40); constraints.fill = GridBagConstraints.NONE; ! constraints.anchor = GridBagConstraints.CENTER; ! gridbag.setConstraints(buttons, constraints); ! panel.add(buttons); return panel; *************** *** 152,155 **** --- 162,168 ---- if (e.getActionCommand().equals(OK_BUTTON)) { saveValues(); + hide(); + } + if (e.getActionCommand().equals(CANCEL_BUTTON)) { hide(); } |