Changeset 12657
- Timestamp:
- 2006-09-04T11:40:48+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/RenamePrompt.java
r12119 r12657 37 37 public class RenamePrompt 38 38 extends JDialog 39 implements ActionListener 39 implements ActionListener, KeyListener 40 40 { 41 41 private JButton cancel_button; … … 66 66 } 67 67 68 public void keyPressed(KeyEvent e) { 69 if (e.getKeyCode() == KeyEvent.VK_ENTER) { 70 // Enter: Click the button in focus 71 Object source = e.getSource(); 72 if (source instanceof AbstractButton) { 73 ((AbstractButton) source).doClick(); 74 } else if (source == name_textfield) { 75 ok_button.doClick(); 76 } 77 } 78 } 79 80 public void keyReleased(KeyEvent e) { } 81 82 public void keyTyped(KeyEvent e) { } 83 68 84 69 85 public String display() … … 84 100 cancel_button.addActionListener(this); 85 101 ok_button.addActionListener(this); 102 ok_button.addKeyListener(this); 103 name_textfield.addKeyListener(this); 86 104 87 105 // Layout
Note:
See TracChangeset
for help on using the changeset viewer.