Java - Guardar archivo desde applet

   
Vista:

Guardar archivo desde applet

Publicado por sebastian (2 intervenciones) el 27/09/2007 22:08:02
Hola. Tengo un applet que genera reportes y luego guarda estos en la pc cliente. Para darle los permisos necesarios se firmo el applet de la siguiente manera:

keytool -genkey -alias myAlias -validity 120 -v

luego

jarsigner.exe miapplet.jar myAlias -verbose

y listo. Con esto se firmo el applet

Utilizamos un jFileChooser para elegir el directorio donde guardar pero sucede que al momento de guardar el archivo, no aparece el filechooser y da el siguiente error:

Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.awt.shell)
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.checkPackageAccess(Unknown Source)
at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at de.muntjak.tinylookandfeel.TinyFileChooserUI.createDirectoryComboBoxModel(TinyFileChooserUI.java:1574)
at de.muntjak.tinylookandfeel.TinyFileChooserUI.installComponents(TinyFileChooserUI.java:188)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JFileChooser.updateUI(Unknown Source)
at javax.swing.JFileChooser.setup(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at ideasjava.cms.dama.Nudam_GeneradorReporte.cuadroGuardarComo(Nudam_GeneradorReporte.java:111)
at ideasjava.cms.dama.Nudam_GeneradorReporte.exportarDatos(Nudam_GeneradorReporte.java:28)
at ideasjava.cms.dama.PanelContenedorTabla.bGuardar_actionPerformed(PanelContenedorTabla.java:75)
at ideasjava.cms.dama.PanelContenedorTabla.access$1(PanelContenedorTabla.java:72)
at ideasjava.cms.dama.PanelContenedorTabla$2.actionPerformed(PanelContenedorTabla.java:51)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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)

si alguien sabe como solucionar este problema o como se hace para guardar archivos desde un applet, seria de gran ayuda
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder