我的问题与带有netBeans的java gui有关 是私人的......(ps->请原谅我的英语......)
private void userTextActionPerformed(java.awt.event.ActionEvent evt) {
String str = evt.getActionCommand();
if(connected)
sendMessage(str);
else{
if((str.length() > 10) &&
(str.subSequence(0, 9).equals("<connect>")) &&
(str.charAt(9)== '<' )&&
(str.charAt(str.length()-1) == '>')&&
(!connected))
{
clientName = str.substring(10, str.length()-1);
userText.setText("");
startConnection();//sweet spot!! this is where i'm stack...
}else{
chatArea.append("Invalid input if you want to connect\nplease type '<connect><Your Name>'\n");
}
}
}