Ignore:
Timestamp:
2010-12-10T20:41:42+13:00 (13 years ago)
Author:
ak19
Message:

Making the OK button in the new folder dialog have the focus on Enter press

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/NewFolderOrFilePrompt.java

    r18370 r23437  
    106106   
    107107    JLabel name_label = new JLabel();
    108         name_label.setComponentOrientation(Dictionary.getOrientation());;
     108        name_label.setComponentOrientation(Dictionary.getOrientation());
    109109    name_field = new JTextField(getAutomaticName());
    110110        name_field.setComponentOrientation(Dictionary.getOrientation());
     111        name_field.selectAll(); // select all the text in the textfield
     112       
    111113    if (type == FileManager.FILE_TYPE) {
    112114        name_label.setText(Dictionary.get("NewFolderOrFilePrompt.File_Name"));
     
    116118        name_field.setToolTipText(Dictionary.get("NewFolderOrFilePrompt.Folder_Name_Tooltip"));
    117119    }
     120
    118121    JPanel button_pane = new JPanel();
    119122        button_pane.setComponentOrientation(Dictionary.getOrientation());
     
    125128    cancel_button.addActionListener(this);
    126129    ok_button.addActionListener(this);
     130    getRootPane().setDefaultButton(ok_button);
    127131
    128132    // Layout
Note: See TracChangeset for help on using the changeset viewer.