import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.event.*;
public class abc extends JFrame implements KeyListener,ActionListener
{    JButton a=new JButton("sdfds");
    JButton b=new JButton("ok");
    JButton c=new JButton("dff");
    int x=0,y=0;
    Container cp=getContentPane();
    
    public abc()
    
    {     
        c.setEnabled(false);
        b.setEnabled(false);
        cp.add(b);        cp.add(c);
        cp.add(a);
        cp.setLayout(new FlowLayout());
         setSize(200,200);
        this.setVisible(true);
       this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        b.addKeyListener(this);
        c.addKeyListener(this);
        b.addActionListener(this);
        c.addActionListener(this);
        a.addActionListener(this);
      
    
    }
     public void actionPerformed(ActionEvent e){
      if(e.getSource()==a)
      c.setEnabled(true);c.setFocusable(true);
      b.setEnabled(true);b.setFocusable(true);
        }
                public void keyPressed(KeyEvent e)
        {
            switch(e.getKeyCode())
            {
            case KeyEvent.VK_LEFT://¹â±ê×ó¼ü
                
                b.setBackground(Color.black);
                c.setBackground(Color.blue);
              
               // b.setLocation(x,y);
                break;
            
            }
        }
        public void keyReleased(KeyEvent Ke)
          {}
    public void keyTyped(KeyEvent Ke)
          {}
       public static void main(String[] arg){
new abc();}}
当你单击a 时侯 b,c被激活 但是键盘事件却不起作用 除非你先点一下那个按纽  
郁闷中......... 冬天裸体跪求答案 多谢!@#$%