Jfile chooser

3 respostas
J
  1. Exception in thread “AWT-EventQueue-1” java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
  2. at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
    
  3. at java.security.AccessController.checkPermission(AccessController.java:546)
    
  4. at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    
  5. at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
    
  6. at java.lang.System.getProperty(System.java:652)
    
  7. at javax.swing.filechooser.FileSystemView.getHomeDirectory(FileSystemView.java:380)
    
  8. at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(MetalFileChooserUI.java:251)
    
  9. at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:136)
    
  10. at javax.swing.plaf.metal.MetalFileChooserUI.installUI(MetalFileChooserUI.java:124)
    
  11. at javax.swing.JComponent.setUI(JComponent.java:673)
    
  12. at javax.swing.JFileChooser.updateUI(JFileChooser.java:1763)
    
  13. at javax.swing.JFileChooser.setup(JFileChooser.java:360)
    
  14. at javax.swing.JFileChooser.<init>(JFileChooser.java:342)
    
  15. at javax.swing.JFileChooser.<init>(JFileChooser.java:301)
    
  16. at Planai.FileBrowserjk(Planai.java:748)
    
  17. at Planai.access$400(Planai.java:45)
    
  18. at Planai$6.actionPerformed(Planai.java:488)
    
  19. at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    
  20. at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    
  21. at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    
  22. at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    
  23. at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    
  24. at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
    
  25. at java.awt.Component.processMouseEvent(Component.java:6041)
    
  26. at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    
  27. at java.awt.Component.processEvent(Component.java:5806)
    
  28. at java.awt.Container.processEvent(Container.java:2058)
    
  29. at java.awt.Component.dispatchEventImpl(Component.java:4413)
    
  30. at java.awt.Container.dispatchEventImpl(Container.java:2116)
    
  31. at java.awt.Component.dispatchEvent(Component.java:4243)
    
  32. at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    
  33. at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
    
  34. at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    
  35. at java.awt.Container.dispatchEventImpl(Container.java:2102)
    
  36. at java.awt.Component.dispatchEvent(Component.java:4243)
    
  37. at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    
  38. at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    
  39. at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    
  40. at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    
  41. at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    
  42. at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:1
    

ao clicar no botao pa explorar os ficheiros da pasta apartir do appletvier tenho esse erro alguem m pode ajudar

3 Respostas

davidtiagoconceicao

Cara, conheço pouco sobre Applets mas, tentando ajudar, fiz umas pesquisas e encontrei estes links:

http://java.sun.com/j2se/1.4.2/docs/guide/deployment/deployment-guide/upgrade-guide/article-04.html

http://java.sun.com/j2se/1.4.2/docs/api/java/security/AccessControlException.html

“This exception is thrown by the AccessController to indicate that a requested access (to a critical system resource such as the file system or the network) is denied.”

O que me leva a pensar que o JFileChooser está tentando acessar um diretório ao qual o usuário não tem acesso.
O JFileChooser tem algum diretório inicial configurado? Se sim, tente verificar se este diretório está disponível para acesso à partir da máquina em que o Applet está sendo executado.

J

Ja foi resolvido e necessario criar um certificado de acesso para poder aceder ao directorio localmente :slight_smile:
resolvi com ajuda de um amigo
se alg tiver duvidas k diga.

davidtiagoconceicao

Beleza, bom saber! :slight_smile:

Criado 29 de novembro de 2008
Ultima resposta 2 de dez. de 2008
Respostas 3
Participantes 2