diff --git a/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/MainView.java b/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/MainView.java index cd078e029ce..44ede02e3eb 100644 --- a/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/MainView.java +++ b/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/MainView.java @@ -118,6 +118,7 @@ public class MainView { private final DataSourcesView dataSourcesView; private final OptionsView optionsView; + private final StartOtpButtonView startOtpButtonView; private final Runnable otpStarter; private final Model model; @@ -139,7 +140,7 @@ public MainView(Runnable otpStarter, Model model) throws HeadlessException { ); this.dataSourcesView = new DataSourcesView(model); this.optionsView = new OptionsView(model); - StartOtpButtonView startOtpButtonView = new StartOtpButtonView(); + this.startOtpButtonView = new StartOtpButtonView(); innerPanel.add(sourceDirectoryView.panel(), CONFIG_SOURCE_DIR_PANEL_CONSTRAINTS); innerPanel.add(dataSourcesView.panel(), CONFIG_DIRS_PANEL_CONSTRAINTS); @@ -176,6 +177,8 @@ public void start() { mainFrame.pack(); mainFrame.setLocationRelativeTo(null); mainFrame.setVisible(true); + + startOtpButtonView.grabFocus(); } private void startOtp() { diff --git a/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/StartOtpButtonView.java b/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/StartOtpButtonView.java index c5668ee3aa5..5c0c1e7a621 100644 --- a/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/StartOtpButtonView.java +++ b/src/ext/java/org/opentripplanner/ext/interactivelauncher/views/StartOtpButtonView.java @@ -29,4 +29,8 @@ public void addActionListener(ActionListener l) { Box panel() { return panel; } + + void grabFocus() { + startOtpBtn.grabFocus(); + } }