set initial focus to done button on terminal server test dialog

This commit is contained in:
Craig Raw 2022-11-21 16:21:30 +02:00
parent 9293b622a3
commit 3cbe8d1537

View file

@ -51,7 +51,9 @@ public class ServerTestDialog extends DialogWindow {
buttonPanel.setLayoutManager(new GridLayout(3).setHorizontalSpacing(1)); buttonPanel.setLayoutManager(new GridLayout(3).setHorizontalSpacing(1));
buttonPanel.addComponent(new Button("Back", this::onBack).setLayoutData(GridLayout.createLayoutData(GridLayout.Alignment.CENTER, GridLayout.Alignment.CENTER, false, false))); buttonPanel.addComponent(new Button("Back", this::onBack).setLayoutData(GridLayout.createLayoutData(GridLayout.Alignment.CENTER, GridLayout.Alignment.CENTER, false, false)));
buttonPanel.addComponent(new Button("Test", this::onTest).setLayoutData(GridLayout.createLayoutData(GridLayout.Alignment.CENTER, GridLayout.Alignment.CENTER, true, false))); buttonPanel.addComponent(new Button("Test", this::onTest).setLayoutData(GridLayout.createLayoutData(GridLayout.Alignment.CENTER, GridLayout.Alignment.CENTER, true, false)));
buttonPanel.addComponent(new Button("Done", this::onDone)); Button doneButton = new Button("Done", this::onDone);
buttonPanel.addComponent(doneButton);
SparrowTerminal.get().getGuiThread().invokeLater(doneButton::takeFocus);
mainPanel.addComponent(new EmptySpace(TerminalSize.ONE)); mainPanel.addComponent(new EmptySpace(TerminalSize.ONE));