Hi guys ,
i wrote a progamm to print messages while the Jchekbox is selected , but the problem is : my gui completely blocked when i check my box (also my jCheckBox is no more selectable). can someone tell me how to resolve the problem ? . here is my code : The red marked code block the gui ( i think)
private void jCheckBox1ItemStateChanged(java.awt.event.ItemEven t evt) {
boolean state = jCheckBox1.isSelected();
if(state ){
try {
send("start tick");
} catch (IOException ex) {
Logger.getLogger(DiagClient.class.getName()).log(L evel.SEVERE, null, ex);
}
try {
do{
socket.receive(buffer);
recvMsg = new String (inData ,0 ,buffer.getLength());
System.out.println(recvMsg);
}
while(buffer.getLength() !=0);
} catch (IOException ex) {
Logger.getLogger(DiagClient.class.getName()).log(L evel.SEVERE, null, ex);
}
}
i wrote a progamm to print messages while the Jchekbox is selected , but the problem is : my gui completely blocked when i check my box (also my jCheckBox is no more selectable). can someone tell me how to resolve the problem ? . here is my code : The red marked code block the gui ( i think)
private void jCheckBox1ItemStateChanged(java.awt.event.ItemEven t evt) {
boolean state = jCheckBox1.isSelected();
if(state ){
try {
send("start tick");
} catch (IOException ex) {
Logger.getLogger(DiagClient.class.getName()).log(L evel.SEVERE, null, ex);
}
try {
do{
socket.receive(buffer);
recvMsg = new String (inData ,0 ,buffer.getLength());
System.out.println(recvMsg);
}
while(buffer.getLength() !=0);
} catch (IOException ex) {
Logger.getLogger(DiagClient.class.getName()).log(L evel.SEVERE, null, ex);
}
}