954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Urgent small help!! Java applet in html

I have to make an audio player in java applet so that it can be used on websites. It will browse files on the computer, make its playlist and will play them one by one.
I have compiled the .jar file and done everything correctly in the tag in html. Now when I try to run it on netbeans (applet emulator) it runes perfectly! However, when I try to run it on HTML page with applet tags, it does not run. it shows the following error:

java.lang.reflect.InvocationTargetException
	at java.awt.EventQueue.invokeAndWait(Unknown Source)
	at main.init(main.java:32)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission C:\Users\Dee Jay'\Documents read)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkRead(Unknown Source)
	at java.io.File.exists(Unknown Source)
	at java.io.Win32FileSystem.canonicalize(Unknown Source)
	at java.io.File.getCanonicalPath(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2.createShellFolder(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2.getPersonal(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
	at sun.awt.shell.ShellFolder.get(Unknown Source)
	at javax.swing.filechooser.FileSystemView.getDefaultDirectory(Unknown Source)
	at javax.swing.JFileChooser.setCurrentDirectory(Unknown Source)
	at javax.swing.JFileChooser.<init>(Unknown Source)
	at javax.swing.JFileChooser.<init>(Unknown Source)
	at main.initComponents(main.java:62)
	at main.access$000(main.java:23)
	at main$1.run(main.java:34)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NullPointerException
	at main.init(main.java:41)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception: java.lang.NullPointerException


Someone told me that I have to do something to read files from the harddisk. I do not understand that.
Please tell me how to solve it ...

noplagiarism
Newbie Poster
8 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

Unsigned applets cannot access the local file system: http://java.sun.com/docs/books/tutorial/deployment/applet/security.html

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

where to find this keytool or jar signer??

noplagiarism
Newbie Poster
8 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

read the JDK documentation

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Keytool and Jarsigner are distributed with the JDK.

Micron
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 1
 

Got it!! Thanks :d

noplagiarism
Newbie Poster
8 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: