当サイトはユーザー体験を改善するためのメンテナンスを実施中に機能が制限される予定です。記事を読んでもあなたの問題が解決せず質問をしたい場合は、Twitter の @FirefoxSupport、Reddit の /r/firefox で、サポートコミュニティが皆さんを助けようと待機しています。

Mozilla サポートの検索

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

詳しく学ぶ

このスレッドはアーカイブに保管されました。 必要であれば新たに質問してください。

Java – Applet doesn’t work on Firefox when usign ForkJoinPool (while in Eclipse works)

  • 3 件の返信
  • 2 人がこの問題に困っています
  • 1 回表示
  • 最後の返信者: Farco

more options

when I run the following code on Eclipse (Luna, java vers=8), the code runs and pops-up the two errors messages. On the other hand, when I embed the code in a html page the code shows only the first error message. It seems that calling the ForkJoinPool class crushes the applet on firefox. Do you know why? Here is the code.

import java.awt.BorderLayout; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.concurrent.ForkJoinPool;

import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingUtilities;

public class ProvaVera extends JApplet {

   public void start() 
   {
       SwingUtilities.invokeLater(new Runnable(){
       public void run() 
           {
               MainPanel panel = new MainPanel();      
               // Add Swing components to content pane
               Container c = getContentPane();
               c.add(panel, BorderLayout.CENTER);
           }
       });
   }

} class MainPanel extends JPanel {

   public MainPanel()
   {
       JLabel label1 = new JLabel("label1");
       this.add(label1);
       JButton btn1 = new JButton("button1");
       this.add(btn1);
       btn1.addActionListener  (
               new ActionListener() 
               {
                   public void actionPerformed(ActionEvent e)
                   {
                       metodo();
                   }
               }
               );
   }


   public void metodo()
   {
       JOptionPane.showMessageDialog(new JFrame(), "test1", "Dialog", JOptionPane.ERROR_MESSAGE);
       ForkJoinPool pool = new ForkJoinPool();
       JOptionPane.showMessageDialog(new JFrame(), "test2", "Dialog", JOptionPane.ERROR_MESSAGE);
   }

}


and here there is the index.html file that embeds the java applet

<applet code="ProvaVera.class" width="800" height="680" <param name="permissions" value="all-permissions" />> </applet>


Thank you in advance

when I run the following code on Eclipse (Luna, java vers=8), the code runs and pops-up the two errors messages. On the other hand, when I embed the code in a html page the code shows only the first error message. It seems that calling the ForkJoinPool class crushes the applet on firefox. Do you know why? Here is the code. import java.awt.BorderLayout; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.concurrent.ForkJoinPool; import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class ProvaVera extends JApplet { public void start() { SwingUtilities.invokeLater(new Runnable(){ public void run() { MainPanel panel = new MainPanel(); // Add Swing components to content pane Container c = getContentPane(); c.add(panel, BorderLayout.CENTER); } }); } } class MainPanel extends JPanel { public MainPanel() { JLabel label1 = new JLabel("label1"); this.add(label1); JButton btn1 = new JButton("button1"); this.add(btn1); btn1.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { metodo(); } } ); } public void metodo() { JOptionPane.showMessageDialog(new JFrame(), "test1", "Dialog", JOptionPane.ERROR_MESSAGE); ForkJoinPool pool = new ForkJoinPool(); JOptionPane.showMessageDialog(new JFrame(), "test2", "Dialog", JOptionPane.ERROR_MESSAGE); } } and here there is the index.html file that embeds the java applet <html> <body> <applet code="ProvaVera.class" width="800" height="680" <param name="permissions" value="all-permissions" />> </applet> </body> </html> Thank you in advance

すべての返信 (3)

more options

Please, could provide a self-contained minimal testcase working on a public page., so we could test on our side.

more options

Hello Oxylatium thank you for your answer,

as you said I put the example on a public page:

     http://latastiera.altervista.org/

but it seems that it does NOT work.

この投稿は Farco により に変更されました

more options

I have enabled the Java console from the java control panel. And the error was: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThread")

So I went to my java.policy file located in java.home/lib/security/ and I wrote the following

grant codeBase "url or file where the applet is" { permission java.lang.RuntimePermission "modifyThread"; };

And now the applet is working.

Again, thank you for your support.