java - Netbeans platform message dialog while connecting to URL -


recently have been working netbeans plugin makes http basic authentication. in order verify password correct have following code.

string url = "http://someurl.com"; urlconnection conn = (new url(url)).openconnection(); httpurlconnection hconn = (httpurlconnection) conn; hconn.setusecaches(false); string input = username.gettext() + ":" + password.gettext(); string output = base64.encode(input.getbytes()); hconn.setrequestproperty("authorization", "basic " + output); hconn.connect(); int code = hconn.getresponsecode(); boolean connectionok = (code == httpurlconnection.http_ok); 

in normal swing application previous code helps show if connetion ok, when put in netbeans platform plugin , connection not ok brings me following dialog. enter image description here

what can disable dialog?

have tried following:

conn.setallowuserinteraction(false); 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -