dvd99
asked on
Java appplets
Hello , is there any way a Applet can use the system like an application?
It's only for my browser so can I add any code, without paying any money?
Thanks!
It's only for my browser so can I add any code, without paying any money?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok BaneBane your answer was great and I will accept it if you tell me a bit more, Will this work on both MS and Netscape browsers?, Do I add that code one under the other and what sork of things can i now do?
Print?,Start other apps?
And will this work on other computers?
Print?,Start other apps?
And will this work on other computers?
Hi.
This solution will work on IE and hopefuly on Netscape (only god know what those guy at Netscape do), anyway I have seen no mention that this solutions shouldn't work on Netscape.
Put the import line at the begining of your applet, as usual.
put the 2nd line as the first line in your start() method.
look at the folowing explanation for what you can do with the assertPermission command.
PermissionID Class Fields
The PermissionID Class contains the following fields.
CLIENTSTORE The permission identifier representing the permission type that controls access to the client storage APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission s.ClientSt oragePermi ssion class.
EXEC The permission identifier representing the permission type that controls the ability to execute applications. This identifier corresponds to the permission implementation in the com.ms.security.permission s.Executio nPermissio n class.
FILEIO A permission identifier representing the permission type that controls the ability to perform file I/O operations. This identifier corresponds to the permission implementation in the com.ms.security.permission s.FileIOPe rmission class.
MULTIMEDIA This identifier corresponds to the permission implementation in the com.ms.security.permission s.Multimed iaPermissi on class.
NETIO The permission identifier representing the permission type that controls networking operations. This identifier corresponds to the permission implementation in the com.ms.security.permission s.NetIOPer mission class.
PRINTING The permission identifier representing the permission type that controls the ability to use the printing APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission s.Printing Permission class.
PROPERTY The permission identifier representing the permission type that controls access to the system properties. This identifier corresponds to the permission implementation in the com.ms.security.permission s.Property Permission class.
REFLECTION The permission identifier representing the permission type that controls the ability to use the reflection APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission s.Reflecti onPermissi on class.
REGISTRY The permission identifier representing the permission type that controls access to the system registry. This identifier corresponds to the permission implementation in the com.ms.security.permission s.Registry Permission class.
SECURITY The permission identifier representing the permission type that controls access to the JDK security APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission s.Security Permission class.
SYSSTREAMS The permission identifier representing the permission type that controls the ability to set the system streams. This identifier corresponds to the permission implementation in the com.ms.security.permission s.SystemSt reamsPermi ssion class.
SYSTEM A special permission identifier that represents all possible permissions. This identifier does not correspond to a specific permission class.
THREAD The permission identifier representing the permission type that controls threading operations. This identifier corresponds to the permission implementation in the com.ms.security.permission s.ThreadPe rmission class.
UI The permission identifier representing the permission type that controls access to extended AWT functionality. This identifier corresponds to the permission implementation in the com.ms.security.permission s.UIPermis sion class.
USERFILEIO The permission identifier representing the permission type that controls access to user-directed file I/O. This identifier corresponds to the permission implementation in the com.ms.security.permission s.UserFile IOPermissi on class.
It has worked on the few computers I checked my applet on.
Btw 5 points... not that I'm complaining or anything (you need to work hard these days.... :-))
Hope this helps.
This solution will work on IE and hopefuly on Netscape (only god know what those guy at Netscape do), anyway I have seen no mention that this solutions shouldn't work on Netscape.
Put the import line at the begining of your applet, as usual.
put the 2nd line as the first line in your start() method.
look at the folowing explanation for what you can do with the assertPermission command.
PermissionID Class Fields
The PermissionID Class contains the following fields.
CLIENTSTORE The permission identifier representing the permission type that controls access to the client storage APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission
EXEC The permission identifier representing the permission type that controls the ability to execute applications. This identifier corresponds to the permission implementation in the com.ms.security.permission
FILEIO A permission identifier representing the permission type that controls the ability to perform file I/O operations. This identifier corresponds to the permission implementation in the com.ms.security.permission
MULTIMEDIA This identifier corresponds to the permission implementation in the com.ms.security.permission
NETIO The permission identifier representing the permission type that controls networking operations. This identifier corresponds to the permission implementation in the com.ms.security.permission
PRINTING The permission identifier representing the permission type that controls the ability to use the printing APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission
PROPERTY The permission identifier representing the permission type that controls access to the system properties. This identifier corresponds to the permission implementation in the com.ms.security.permission
REFLECTION The permission identifier representing the permission type that controls the ability to use the reflection APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission
REGISTRY The permission identifier representing the permission type that controls access to the system registry. This identifier corresponds to the permission implementation in the com.ms.security.permission
SECURITY The permission identifier representing the permission type that controls access to the JDK security APIs. This identifier corresponds to the permission implementation in the com.ms.security.permission
SYSSTREAMS The permission identifier representing the permission type that controls the ability to set the system streams. This identifier corresponds to the permission implementation in the com.ms.security.permission
SYSTEM A special permission identifier that represents all possible permissions. This identifier does not correspond to a specific permission class.
THREAD The permission identifier representing the permission type that controls threading operations. This identifier corresponds to the permission implementation in the com.ms.security.permission
UI The permission identifier representing the permission type that controls access to extended AWT functionality. This identifier corresponds to the permission implementation in the com.ms.security.permission
USERFILEIO The permission identifier representing the permission type that controls access to user-directed file I/O. This identifier corresponds to the permission implementation in the com.ms.security.permission
It has worked on the few computers I checked my applet on.
Btw 5 points... not that I'm complaining or anything (you need to work hard these days.... :-))
Hope this helps.
> (only god know what those guy at Netscape
> do), anyway I have seen no mention that this solutions
> shouldn't work on Netscape.
those guy in Netscape are implementing standard Java, and I\m sure that they do not use
com.ms.security.PolicyEngi ne
class :)
just 2c
> do), anyway I have seen no mention that this solutions
> shouldn't work on Netscape.
those guy in Netscape are implementing standard Java, and I\m sure that they do not use
com.ms.security.PolicyEngi
class :)
just 2c
ASKER