解决方案 »

  1.   

    上述代码类型的“MyJButton000”类的源代码如下:
        package cjco;/**
     * 
     */import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.DataOutputStream;
    import java.net.InetAddress;
    import java.net.UnknownHostException;import javax.swing.JButton;/**
     * @author cjco
     * 
     */
    public class MyJButton000 extends JButton {
         /**
     * 
     */
     //【注意】:最新设计思路:让MyJButton控件,向C端的ChatClient中,传入一个值,让C端的ChatClient类,向S端“写入”:新添加的参数:“Systemcontrolname”控件名。
    //将所有的参与到系统中的“每一个待点击广告JButton控件和所有的JLabel控件,进行"主键值命名所有控件的名字",传递他们的控件名,至S端进行"匹配"”。
    //教师储存数据容器:首位Key为"教师编号",之后是Value为"与教师交谈窗口对象".
    private static final long serialVersionUID = 1L;
    static int complicatingChatNum = 0;
    Integer SendIndex = -1;
    String S_PORT_SERVER = "127.0.0.1";
    static String MyMemWorkroomspace = "";
    String MyURLLocal = "";
    String iPAddress = null;
    DataOutputStream dops = null;
    //
    public MyJButton000(String button,String MyURL,final String Teacher_facia,int SysprimaKey,final int online,int complicatingnum) {
    super(MyMemWorkroomspace+button + ":" + complicatingnum);
    changeworkroomspace("1");
    MyURLLocal = MyURL;
    InetAddress addr = null;
    try {
    addr = InetAddress.getLocalHost();
    } catch (UnknownHostException e2) {
    // TODO Auto-  catch block
    e2.printStackTrace();
    }
    iPAddress = addr.getHostAddress().toString();
    SendIndex = new Integer(SysprimaKey);
    if(online == 0){
    this.setEnabled(false);
    }
    else{
    this.setEnabled(true);
    }
    this.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    }});
    }

    public void updateMyUI(String Mybtnsname,String MyUserFrificia,int online,int complicatingnum,String MemWorkroomspace,Integer SendIndex){
    changeworkroomspace(MemWorkroomspace);
    this.setText(MyMemWorkroomspace+Mybtnsname + ":" + complicatingnum);
    if(online==0){
    this.setEnabled(false);
    }else{
    this.setEnabled(true);
    }
    }

    public void changeworkroomspace(String Myroomspace){
    if(Myroomspace.equals("0")){
    MyMemWorkroomspace = "(满)";
    }else{
    MyMemWorkroomspace = "";
    }
    }
    }    我在这个地址提出了一个问题:
        http://bbs.csdn.net/topics/390704469?page=1#post-396705784
        由于我的代码少写了一个MyJButton000的类型,无法运行,导致我的问题,写的不完整.
        希望能够有高手,为我:
        做点拨!!
        弟我成佛后,一定:
        用最认真的努力付出,与辛勤学习,劳动,克己,忍耐,来为帮助我的老师,做回报!!