src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.java
branchv_0
changeset 41 64e564c2f069
parent 39 ec0e970e0830
child 42 d2414701ce09
     1.1 --- a/src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.java	Sat Dec 16 23:54:00 2023 +0100
     1.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.java	Tue Dec 19 00:47:41 2023 +0100
     1.3 @@ -20,6 +20,7 @@
     1.4  import cz.frantovo.rozsireneatributy.CSV;
     1.5  import java.awt.Toolkit;
     1.6  import java.awt.datatransfer.StringSelection;
     1.7 +import java.awt.event.KeyEvent;
     1.8  import java.io.IOException;
     1.9  import java.io.StringWriter;
    1.10  import java.util.ResourceBundle;
    1.11 @@ -27,6 +28,7 @@
    1.12  import java.util.logging.Logger;
    1.13  import javax.swing.JOptionPane;
    1.14  import javax.swing.JTable;
    1.15 +import javax.swing.KeyStroke;
    1.16  import javax.swing.ListSelectionModel;
    1.17  import javax.swing.event.ListSelectionEvent;
    1.18  import javax.swing.event.ListSelectionListener;
    1.19 @@ -62,7 +64,7 @@
    1.20  
    1.21  		tabulka.setRowHeight((int) (tabulka.getRowHeight() * 1.3));
    1.22  
    1.23 -		/** Výběr aktuálního atributu v tabulce */
    1.24 +		// Výběr aktuálního atributu v tabulce:
    1.25  		tabulka.getSelectionModel().addListSelectionListener(
    1.26  			new ListSelectionListener() {
    1.27  
    1.28 @@ -78,6 +80,10 @@
    1.29  				}
    1.30  			}
    1.31  		});
    1.32 +
    1.33 +		// Buňky tabulky editovatelné po stisku mezerníku:
    1.34 +		tabulka.getInputMap()
    1.35 +			.put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "startEditing");
    1.36  	}
    1.37  
    1.38  	private void nastavEditor() {