This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Authenticator  RSS feed

 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I really need some advice and guidance on the following code



As you guys see above there is JOptionPane that requests both the username and password to access a http website, but i have a dilemma about someting about the method getPasswordAuthentication() that i am supposed to overide.

The thing is i am afraid the getPasswordAuthentication() method may actually return the value of the of both the username and password before the user has even had the chance to type in the correct
username and password.

As you guys can see that the gui that i set gets the value of the input optionpane and i was hoping that that the function returns after the user had pressed "OK" but the thing is i suspect that the function may be returning as soon as the option pane is shown thus causing both the values of the username and password to be null.

Am i using the Authenticator class with gui the correct way or am i missing something??

I really hope someone can explain to me in detail on how this Authenticator class works and maybe help suggest a possible solution that can help me out of my dillema.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question on multiple forums. If you uncertain as to which forum a question belongs, post it in one of the "Java In General" forums. If it would be better suited in a different forum a moderator will move the topic for you.
Some more hints here: How To Ask Questions On Java Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!