[ Back | Previous | Next ]

How select a row in a table from keyboard by enter?

Package:
javax.swing.*
Product:
1.0.3
Release:
Swing
Related Links:
ComboBox
JDialog
JFileChooser
JFrame
JOptionPane
JProgressBar
JScrollPane
JTable
General
JTree
JWindow
KeyStroke
LayeredPane
UIDefaults
Comment:

			ivjOverzichtTable.registerKeyboardAction(//
			new ActionListener() {
				public void actionPerformed(ActionEvent ae) {
					dbg("ActionEvent:	" + ae);
					try {
						_copierWaarden(getOverzichtTable().getSelectedRow());
						getZoekFrame().setVisible(false);
						getZoekFrame().dispose();
					} catch (Exception ee) {
						dbg("MouseListener: " + ee);
						handleException(ee);
					}
				}
			}
			, //
			"Select", //
			KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER, 0), //
			JComponent.WHEN_FOCUSED //
			);
1