Ignore:
Timestamp:
2010-10-31T10:45:27+01:00 (14 years ago)
Author:
guardian
Message:

better time input

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java

    r23667 r23953  
    2222import javax.swing.JPanel;
    2323import javax.swing.JRadioButtonMenuItem;
     24import javax.swing.SwingUtilities;
    2425import javax.swing.text.MaskFormatter;
    2526
     
    180181                try {
    181182                JOptionPane d=new JOptionPane(tr("Jump to"), JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
    182                 JFormattedTextField inp = new JFormattedTextField(new MaskFormatter("##:##:##"));
     183                final JFormattedTextField inp = new JFormattedTextField(new MaskFormatter("##:##:##"));
    183184                inp.setText("00:00:01");
    184185                inp.setInputVerifier(new InputVerifier() {                                     
     
    189190                                        }
    190191                                });
     192                SwingUtilities.invokeLater(new Runnable() {
     193                    public void run() {
     194                        inp.requestFocus();
     195                    }
     196                });
    191197                //TODO here we should show the GPS time range to the user
    192198                if(d.showConfirmDialog(Main.main.panel,inp, tr("Jump to"),JOptionPane.OK_CANCEL_OPTION)==JOptionPane.OK_OPTION)
    193199                {
    194                         s=inp.getText();
    195200                        Date t;
    196201                        SimpleDateFormat sdf= new SimpleDateFormat("hh:mm:ss");
    197                         t = sdf.parse(s);
     202                        t = sdf.parse(inp.getText());
    198203                        if (t!=null)
    199204                        {
Note: See TracChangeset for help on using the changeset viewer.