Hi, I am try KeyBinding in JButtons(add, edit and delete JButton). Edit and Delete buttons works fine but Add button does not fire action event even if i press control+A keys. So I copy the original code in the small programm and it works.

Am I missing somthing?

Here is the original code
Java Code:
        btnAdd.getActionMap().put("ADD", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   btnAddActionPerformed(e);
            }
        });

        btnAdd.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                KeyStroke.getKeyStroke("control A"), "ADD");

        btnEdit.getActionMap().put("EDIT", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   btnEditActionPerformed(e);
            }
        });

        btnEdit.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                KeyStroke.getKeyStroke("control E"), "EDIT");

        btnDelete.getActionMap().put("DELETE", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   btnDeleteActionPerformed(e);
            }
        });

        btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                KeyStroke.getKeyStroke("control D"), "DELETE");
And here is the small program I try to check if it will work.
Java Code:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class KeyBindingTrial extends JFrame
{   private JPanel pnlTop, pnlCenter, pnlBottom, pnlSection1, pnlSection2, pnlBtn;
    private JPanel pnlTopCombo1, pnlTopCombo2;

    private JLabel lblCombo1, lblCombo2;
    private JComboBox combo1, combo2;
    private JButton btnCombo1, btnCombo2;

    private JButton btnAdd, btnEdit, btnDelete;

    private JLabel lblSection1, lblSection2;

    private int activeSection;
    public KeyBindingTrial()
    {   this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        pnlTop = new JPanel();
        pnlCenter = new JPanel();
        pnlBottom = new JPanel();
        pnlSection1 = new JPanel();
        pnlSection2 = new JPanel();
        pnlBtn = new JPanel();
        pnlTopCombo1 = new JPanel();
        pnlTopCombo2 = new JPanel();

        lblCombo1 = new JLabel("WINDOW'S SECTION");
        combo1 = new JComboBox();
        combo1.addItem("SHOW SECTION 1");
        combo1.addItem("SHOW SECTION 2");
        btnCombo1 = new JButton("<html><font color='red'><b><u>V</u></b></font> IEW</html>");

        lblCombo2 = new JLabel("SHOW OTHER WINDOW");
        combo2 = new JComboBox();
        combo2.addItem("WINDOW 1");
        combo2.addItem("WINDOW 2");
        btnCombo2 = new JButton("<html><font color='red'><b><u>S</u></b></font> HOW</html>");

        btnAdd = new JButton("<html><font color='red'><b><u>A</u></b></font> DD</html>");
        btnEdit = new JButton("<html><font color='red'><b><u>E</u></b></font> DIT</html>");
        btnDelete = new JButton("<html><font color='red'><b><u>D</u></b></font> ELETE</html>");

        this.setLayout(new BorderLayout());
        this.add(pnlTop, BorderLayout.PAGE_START);
        this.add(pnlCenter, BorderLayout.CENTER);
        this.add(pnlBottom, BorderLayout.PAGE_END);

        pnlTop.setLayout(new GridLayout(1, 2, 20, 0));
        pnlTop.add(pnlTopCombo1);
        pnlTop.add(pnlTopCombo2);

        pnlTopCombo1.setLayout(new BorderLayout());
        pnlTopCombo1.add(lblCombo1, BorderLayout.PAGE_START);
        pnlTopCombo1.add(combo1, BorderLayout.CENTER);
        pnlTopCombo1.add(btnCombo1, BorderLayout.LINE_END);

        pnlTopCombo2.setLayout(new BorderLayout());
        pnlTopCombo2.add(lblCombo2, BorderLayout.PAGE_START);
        pnlTopCombo2.add(combo2, BorderLayout.CENTER);
        pnlTopCombo2.add(btnCombo2, BorderLayout.LINE_END);

        pnlCenter.setLayout(new BorderLayout());
        pnlCenter.add(pnlBtn, BorderLayout.LINE_END);

        pnlBtn.setSize( new Dimension(10, 100) );
        pnlBtn.setLayout( new GridLayout( 3,0,5,5 ) );
        pnlBtn.add(btnAdd);
        pnlBtn.add(btnEdit);
        pnlBtn.add(btnDelete);

        lblSection1 = new JLabel("THIS IS SECTION 1");
        pnlSection1.add(lblSection1);

        lblSection2 = new JLabel("THIS IS SECTION 2");
        pnlSection2.add(lblSection2);

        btnCombo1.addActionListener(new ActionListener()
        {   public void actionPerformed(ActionEvent e)
            {   viewActionPerformed(e);  }
        });

        btnCombo2.addActionListener(new ActionListener()
        {   public void actionPerformed(ActionEvent e)
            {   showActionPerformed(e);  }
        });

        btnAdd.addActionListener(new ActionListener()
        {   public void actionPerformed(ActionEvent e)
            {   addActionPerformed(e);  }
        });

        btnEdit.addActionListener(new ActionListener()
        {   public void actionPerformed(ActionEvent e)
            {   editActionPerformed(e);  }
        });

        btnDelete.addActionListener(new ActionListener()
        {   public void actionPerformed(ActionEvent e)
            {   deleteActionPerformed(e);  }
        });

        pack();

        shortcutkeys();
    }

    public static void main(String[] args)
    {   new KeyBindingTrial().setVisible(true);
    }

    private void viewActionPerformed(ActionEvent ae)
    {   activeSection = combo1.getSelectedIndex();
        switch (combo1.getSelectedIndex())
        {   case 0:
                pnlCenter.add(pnlSection1);
                pnlCenter.remove(pnlSection2);
                repaint();
                validate();
            break;
            case 1:
                pnlCenter.add(pnlSection2);
                pnlCenter.remove(pnlSection1);
                repaint();
                validate();
            break;
        }
    }
    private void showActionPerformed(ActionEvent ae)
    {   JOptionPane.showMessageDialog(this, "Show window :" +
                        combo2.getSelectedItem(),"MESSAGE:", JOptionPane.INFORMATION_MESSAGE);
    }

    private void addActionPerformed(ActionEvent ae)
    {   JOptionPane.showMessageDialog(this, "ADD Action Event","MESSAGE:", JOptionPane.INFORMATION_MESSAGE);
    }

    private void editActionPerformed(ActionEvent ae)
    {   JOptionPane.showMessageDialog(this, "EDIT Action Event","MESSAGE:", JOptionPane.INFORMATION_MESSAGE);
    }

    private void deleteActionPerformed(ActionEvent ae)
    {   JOptionPane.showMessageDialog(this, "DELETE Action Event","MESSAGE:", JOptionPane.INFORMATION_MESSAGE);
    }

    private void shortcutkeys()
    {   btnCombo1.getActionMap().put("VIEW", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   viewActionPerformed(e);
            }
        });

        btnCombo1.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
                .put(KeyStroke.getKeyStroke("control V"), "VIEW");

        btnCombo2.getActionMap().put("SHOW", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   showActionPerformed(e);
            }
        });

        btnCombo2.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
                .put(KeyStroke.getKeyStroke("control S"), "SHOW");

        btnAdd.getActionMap().put("action_ADD", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   addActionPerformed(e);
            }
        });

        btnAdd.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                KeyStroke.getKeyStroke("control A"), "action_ADD");

        btnEdit.getActionMap().put("EDIT", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   editActionPerformed(e);
            }
        });

        btnEdit.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                KeyStroke.getKeyStroke("control E"), "EDIT");

        btnDelete.getActionMap().put("DELETE", new AbstractAction()
        {   public void actionPerformed(ActionEvent e)
            {   deleteActionPerformed(e);
            }
        });
    }
}
Thanks,
geje