Hello Coders! I�m developing a chat program based on Swing. The client has lots of features and plenty of internal work to do. I sense delay when I�m pressing on a button and it takes extra time until the button return to its undressed state. My questions are : 1.Do I need to keep all the hard work to the server? 2.Do I need to worry about the delay symptoms ? 3.Whenever I divide an operation to a several method,does it increase the processing time? 4.does objects effects in some way on the processing time (I mean importing and using them) Thanks in advance Shay
when I�m pressing on a button and it takes extra time until the button return to its undressed state. what r u doing in actionPerformed for this button r u using servlet as server?? r u making connection to server on button press??
Originally posted by Shay Gaghe: Hello Coders! I�m developing a chat program based on Swing. The client has lots of features and plenty of internal work to do. I sense delay when I�m pressing on a button and it takes extra time until the button return to its undressed state. My questions are : 1.Do I need to keep all the hard work to the server? 2.Do I need to worry about the delay symptoms ? 3.Whenever I divide an operation to a several method,does it increase the processing time? 4.does objects effects in some way on the processing time (I mean importing and using them) Thanks in advance Shay
Hi >r u using servlet as server?? >r u making connection to server on button press?? In my program I use an application that based on ServerSocket as the server. My client has to deal with plenty of internal operation like changing graphical states, drawing images and sending streams. My start button make the first connection to server and in the other hand sends a login request to the server , the time that takes to concocted the necessary information ,send and receive the server�s response makes the button to wait until all of those task will be completed to change its state back to unpressed state. If that not clear I�ll post the actionPerformed() here. thanks
ok i too faced similar problem the reason is once control gets inside actionPerformed paint is not called in a frame or applet until it gets out of actionPerformed try putting an infionite loop in actionPerformed and press the button u will find that button remains pressed forever the solution i think is whatever you are doing on that button click do it in a seperate thread
or try following call validate () doLayout() show() repaint() or these type of component class method not sure but this can also solve ur prob but prefer first method if it is possible for u to create a new thread i think it will definitely solve ur problem parul patidar
Originally posted by Shay Gaghe: Hi >r u using servlet as server?? >r u making connection to server on button press?? In my program I use an application that based on ServerSocket as the server. My client has to deal with plenty of internal operation like changing graphical states, drawing images and sending streams. My start button make the first connection to server and in the other hand sends a login request to the server , the time that takes to concocted the necessary information ,send and receive the server�s response makes the button to wait until all of those task will be completed to change its state back to unpressed state. If that not clear I�ll post the actionPerformed() here. thanks
Post by:autobot
I don't always make ads but when I do they're tiny
a bit of art, as a gift, that will fit in a stocking