Ok, dopo un po' di maneggiamenti (CTRL TAB intereferisce con i focus) e l'aiuto del forum della sun:
codice:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class keysComb extends JFrame {
JTextArea ta = new JTextArea("Premi CTRL+TAB");
public keysComb() {
super("Prova tasti multipli");
this.getContentPane().add(ta);
this.setSize(400, 400);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
KeyStroke ctrlTab = KeyStroke.getKeyStroke("ctrl TAB" );
Set set = new HashSet(ta.getFocusTraversalKeys( KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS) );
set.remove(ctrlTab);
ta.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);
Action writeAction = new AbstractAction() {
public void actionPerformed(ActionEvent ae) {
ta.append("\nHai premuto CTRL+TAB: bravo\n");
}
};
ta.getInputMap().put(ctrlTab, writeAction);
}
public static void main (String[] args) {
keysComb kc = new keysComb();
}
}
Metti nella Action quel che ti serve.