/*
 * @(#)TabKeyTest.java  1.0  2009-12-24
 * 
 * Copyright (c) 2009 Werner Randelshofer
 * Hausmatt 10, Immensee, CH-6405, Switzerland.
 * All rights reserved.
 * 
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Werner Randelshofer. For details see accompanying license terms.
 */
import java.awt.event.*;
import javax.swing.*;
/**
 * TabKeyTest.
 *
 * @author Werner Randelshofer
 * @version 1.0 2009-12-24 Created.
 */
public class TabKeyTest extends javax.swing.JPanel {

    /** Creates new form TabKeyTest */
    public TabKeyTest() {
        initComponents();
        setRequestFocusEnabled(true);
        setFocusTraversalKeysEnabled(false);
        addMouseListener(new MouseAdapter() {

            public void mousePressed(MouseEvent e) {
                requestFocus();
            }
        });
        addKeyListener(new KeyListener() {

            public void keyTyped(KeyEvent e) {
             System.out.println(e);
            }

            public void keyPressed(KeyEvent e) {
             System.out.println(e);
            }

            public void keyReleased(KeyEvent e) {
             System.out.println(e);
            }
        });
    }
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
               JFrame f = new JFrame("TabKeyTest");
               f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               f.add(new TabKeyTest());
               f.setSize(400,400);
               f.setVisible(true);
            }
        });
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
