buňky tabulky editovatelné po stisku mezerníku v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 19 Dec 2023 00:47:41 +0100
branchv_0
changeset 4164e564c2f069
parent 40 1978eaf429de
child 42 d2414701ce09
buňky tabulky editovatelné po stisku mezerníku
src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.java
     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() {