//单选按钮事件处理 
      class RadioListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
               //tabbedPane.setSelectedComponent(panel1);
                 //tabbedPane.setNextFocusableComponent(panel3);
             
}

    
     //成绩输入事件处理
      class InActionListener implements ActionListener
      {
       public void actionPerformed(ActionEvent event)
       {
       if(i<st.length)
       {
       st[i].SNumber=Integer.valueOf(TNumberIn.getText()).intValue();
           st[i].Score=Integer.valueOf(TScoreIn.getText()).intValue();
           };
           i++;
        TNumberIn.setText("");
        
        }
      }
      //成绩查询事件处理
      class QueryActionListener implements ActionListener
      {
       public void actionPerformed(ActionEvent event)
       {
            int keyWord,i=0;
            String s=new String();
            keyWord=Integer.valueOf(TNumberQuery.getText()).intValue();
            for(i=0;i<st.length;i++)
            if(st[i].SNumber==keyWord)
            {
             TScoreQuery.setText(s.valueOf(st[i].Score));
               break;
              };
              if(i>=st.length)
                 TScoreQuery.setText("未找到您的成绩");
              
         }  
         
               
      }
      //修改事件处理
      class UpdateActionListener implements ActionListener
      {
       public void actionPerformed(ActionEvent event)
       {
       int id,i=0;
       String u=new String();
       id=Integer.valueOf(TNumberQuery.getText()).intValue();
       if(st[i].SNumber==id)
       {
       TScoreAgo.setText(u.valueOf(st[i].Score));
          
        }
      
       st[i].Score=Integer.valueOf(TScoreUpdate.getText()).intValue();
      
       TScoreUpdate.setText("");
       TScoreAgo.setText("");
       TNumberUpdate.setText("");
        }
      }
      
      public  static void  main(String args[])
      {
              Demo6 demo=new Demo6();      }
}

解决方案 »

  1.   

    Bluecatr(蓝夜猫儿) 
    你说的对啊
    我是不知道如何做到要求那样子啊
    所以问问~~~
    我的逻辑哪有问题啊,请指出啊~~
     oxv(花生壳) (
    没有错误
    只是功能实现不了~~
      

  2.   

    简单点改一下选中教师、学生、管理员后的按钮状态,可将就实现你的需求class RadioListener implements ActionListener{
      public void actionPerformed(ActionEvent e){  
        if(e.getSource() == teacherButton){
          BIn.setEnabled(true);
          BQuery.setEnabled(true);
          BUpdate.setEnabled(false);
        }else if(e.getSource() == studentButton){
               //类似上述方法    
        }else if(e.getSource() == manageButton){
               //类似上述方法
        }             
    }
      

  3.   

    iversonxk(艾弗森):感谢~~~ ntzls(三星堆) ( ) :
    无语~~
    大哥啊!!!
    谢谢~~~