void displayError( Throwable e, Displayable next ){ Alert a = new Alert( "Exception" ); a.setString( e.toString() ); a.setTimeout( Alert.FOREVER ); display.setCurrent( a, next ); }
class URLEntry extends TextBox implements CommandListener {
buf.append( line ); text.setText( buf.toString() ); } } }
but i'm getting the warning as:
Warning: To avoid potential deadock,operations that may block,such as networking should be performed ina different thread than the commandAction() handler.
Well, I can't read your code because there is no formatting or indentation. I tried to edit your post, expecting to see indentation and just add the [/CODE] tags around it, but there was no indentation.
But you are just receiving a warning and not an error, you can still run your application. It is just saying that you are going to use COmmunication somewhere where the program will hang and wait until it gets a response, in some cases that is fine.
If you wanted to run the Communication in a seperate thread, therefore not block your app, then you won't see the warning again, but you can disregard the warning too.
You are closing the connection (c.close()) in commandAction(), this is the reason for the warning. Note this is just a warning, but preferably you should do c.close() in another thread (not the system thread that invokes commandAction()).
You will not receive other UI events until commandAction() returns ie in your code until c.close() returns. c.close() is a networking operation and may be a time-consuming operation ...