rendered paste bodyimport java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class test extends JWindow{
private JPanel container;
private JTextArea textArea;
public test(){
setLayout(new BorderLayout());
container = new JPanel();
textArea = new JTextArea("foo bar");
textArea.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F12,0), "exitAction");
textArea.getActionMap().put("exitAction", new AbstractAction(){
public void actionPerformed(ActionEvent e){
System.exit(0);
}
});
container.add(textArea);
add(container, BorderLayout.CENTER);
setSize(400,400);
setVisible(true);
}
public static void main(String[] a){
new test();
}
}