public class PromptingAuthenticator extends Authenticator
Authenticator
which will prompt the user to enter
the required name and password with a Swing dialog. Names and passwords
are cached by default, but this behaviour can be disabled by calling setCaching(boolean)
.
To use, simply call Authenticator.setDefault(new PromptingAuthenticator(component))
Authenticator.RequestorType
Constructor and Description |
---|
PromptingAuthenticator()
Create a new PromptingAuthenticator with no root component specified
|
PromptingAuthenticator(Component root)
Create a new PromptingAuthenticator and specify the Component the dialog should be opened above
|
Modifier and Type | Method and Description |
---|---|
protected PasswordAuthentication |
getPasswordAuthentication() |
void |
setCaching(boolean cache)
Set whether to cache names/passwords - if true (the default), the dialog will
be presented with the previous values already specified.
|
void |
setRoot(Component root)
Set the root Component the dialog should be opened above
|
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
public PromptingAuthenticator()
public PromptingAuthenticator(Component root)
root
- the root component for the dialogpublic void setRoot(Component root)
root
- the root component for the dialogpublic void setCaching(boolean cache)
cache
- whether to cache names/passwordprotected PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication
in class Authenticator
Copyright © 2001-2017 Big Faceless Organization