properties dialog closable with esc
This commit is contained in:
parent
9e02b23f49
commit
7ec4ca8946
@ -15,7 +15,7 @@ import java.io.InputStreamReader;
|
||||
*/
|
||||
public class MainApp {
|
||||
|
||||
public static final String APP_VERSION = "1.1.0";
|
||||
public static final String APP_VERSION = "1.1.1";
|
||||
|
||||
public enum OS {
|
||||
WINDOWS, LINUX, MACOS, UNKNOWN
|
||||
|
||||
@ -6,6 +6,7 @@ import cz.kamma.kfmanager.model.FileItem;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.*;
|
||||
@ -64,6 +65,10 @@ public class PropertiesDialog extends JDialog {
|
||||
buttonPanel.add(okButton);
|
||||
buttonPanel.add(cancelButton);
|
||||
add(buttonPanel, BorderLayout.SOUTH);
|
||||
|
||||
getRootPane().registerKeyboardAction(e -> dispose(),
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
|
||||
JComponent.WHEN_IN_FOCUSED_WINDOW);
|
||||
}
|
||||
|
||||
private JPanel buildPropertiesPanel() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user