Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why isn't PrivilegeManager.enablePrivilege(...) working???????

Status
Not open for further replies.

rmcweb

Programmer
Jul 26, 2001
7
US
I have a quick question concerning my simple signed applet. All it does is display the client's username (I included the pertinent code).However, after Netscape prompts the user to grant the privilege, it only displays
user=
instead of
user= (The client's username)
Why would it print an empty string as if the privilege wasn't enabled? Please help

import netscape.security.*;
public class NewName extends Applet
{
public String msg;

public void update(Graphics gp){
PrivilegeManager.enablePrivilege("UniversalPropertyRead");
try
{
msg= System.getProperty("user.name");
}
catch (Exception e)
{
msg= "Get username failed: " + e;
}
gp.drawString("user= " + msg, 20, 20);
}
public void paint(Graphics gp){
update(gp);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top