日期:2014-05-20  浏览次数:20716 次

求高手点拨:“我的程序中的错误原因”,一个关于集合的使用的技术问题...
诸位高手,大家好:
    我是一名学习软件工程的学生,近日,我碰到了下面的一个问题:
    这是我定义的“JButton控件”的“子类”:MyJButton的源代码:
     private static final long serialVersionUID = 1L;
int i = 0;
public MyJButton0(String button, final String url,final String doctor_name,final int Systemcontrolname,int online,int complicatingnum) {
super(button);
this.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
// 定义网址为webSite的内容

URI uri = new URI(url);
Desktop desktop = Desktop.getDesktop();
desktop.browse(uri);    String str9 = doctor_name;
new ChatClient(str9,Systemcontrolname);
i++;
} catch (URISyntaxException e1) {
} catch (IOException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
}
}
});
}
}
------------------------------------------------------------
    这是我的”C_port_ChatClient_DS类“的代码:
    public class C_port_ChatObject_DS {
    public static final String JB0 = null;
public String UIDLocal = null;
    String roleLocal = null;
    int ChatObjectUIDLocal = -1;
    Socket so1 = null;
Socket so2 = null;
Socket so3 = null;
String IPAddress = null;
static int orderformnumDoctor = 0;
int Localonline = 0;
int Clientnum = 0;
 

public C_port_ChatObject_DS(String UID,String role,int ChatObjectUID,Socket s1,Socket s2,Socket s3,String IPaddress,int orderformnum){
if(UIDLocal!=null)
UIDLocal = UID;
if(role!=null)
roleLocal = role;
if(ChatObjectUID!=-1)
ChatObjectUIDLocal = ChatObjectUID;
if(so1!=null)
so1 = s1;
if(so2!=null)
so2 = s1;
if(so3!=null)
so3 = s3;
if(IPAddress != null)
IPAddress = IPaddress;
if(orderformnum!=0)
orderformnumDoctor = orderformnum;
}

public C_port_ChatObject_DS(String UID,String role,int ChatObjectUID,String IPaddress,Socket s1){
if(UIDLocal!=null)
UIDLocal = UID;
if(role!=null)
roleLocal = role;
if(ChatObjectUID!=-1)
ChatObjectUIDLocal = ChatObjectUID;
if(IPaddress!=null)
IPAddress = IPaddress;
if(so1!=null)
so1 = s1;
}
public C_port_ChatObject_DS(Socket s2,Socket s3){
if(so2!=null)
so2 = s2;
if(so3!=null)
     so3 = s3;
}
public C_port_ChatObject_DS(){
UIDLocal = null;
    roleLocal = null;
    ChatObjectUIDLocal = -1;
    so1 = null;
so2 = null;
so3 = null;
IPAddress = null;
orderformnumDoctor = 0;
Localonline = 0;
Clientnum = 0;
}

}