Problem with JTable and event overload

A

Akey

Hi,
I have a problem with JTable and KeyEvent.VK_DOWN event overload.
I write this code:

Action kp_down = new AbstractAction()
{
public void actionPerformed(ActionEvent e)
{
//........
}
};
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "kp_down") ;
getActionMap().put("kp_down",kp_down);

Grazie,
Carlo
 
T

Tor Iver Wilhelmsen

Akey said:
Sorry,
My problem is: JScrollPane does not update automatically.

Of course not, you're still in the event dispatch thread when your
code executes. You need to use e.g. SwingUtilities.invokeLater() to
move processing out of the event thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top