1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Serial monitor: input textfield is automatically selected

When the serial monitor window is focused again (not reopened but put
in background and selected again) the text input field is now
automatically focused.

Fix #5810
This commit is contained in:
Cristian Maglie 2017-02-16 20:16:03 +01:00
parent e9e24bd369
commit 4d6385ab6d
2 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,8 @@ import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.Box;
import javax.swing.BoxLayout;
@ -66,6 +68,13 @@ public abstract class AbstractTextMonitor extends AbstractMonitor {
upperPane.setBorder(new EmptyBorder(4, 4, 4, 4));
textField = new JTextField(40);
// textField is selected every time the window is focused
addWindowFocusListener(new WindowAdapter() {
public void windowGainedFocus(WindowEvent e) {
textField.requestFocusInWindow();
}
});
sendButton = new JButton(tr("Send"));
upperPane.add(textField);

View File

@ -4,6 +4,7 @@ ARDUINO 1.8.2
* Fix command line: works again with relative paths (regression)
* Update arduino-builder to 1.3.24 to avoid name clashing for libraries
* Allow BoardManager to fetch FreeBSD tools (thanks @kevans91)
* Serial monitor: the input string box is automatically focused when window is selected
[core]
* Add Atmel-ICE and JTAGICE3 programmers for AVR chips (thanks @matthijskooijman)