Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: Re: Applets? Date: Tue, 15 Sep 2015 17:56:45 -0700 Organization: A noiseless patient Spider Lines: 73 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 16 Sep 2015 00:54:52 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e4bb2c7dad0e79edbbf184ec68513a50"; logging-data="22906"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gmqpf0WEeJpE8mcYCyoV5" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: Cancel-Lock: sha1:BToqXD9BftVqbNeJWR1HnuMPg0s= Xref: csiph.com comp.lang.java.programmer:32589 My best guess is you are using a 64bit Windows system and don't have 32bit Java installed. You need the i586 JRE if you have a 64bit Windows OS because Firefox is only 32bit. You are going to have other problems though too. Applets are very difficult to run anymore without code signing them. You will need to use the Configure Java program to allow Applets to run. If you want to run them from your local file system (and you have a Windows machine), add file:/ to the exceptions list. If you are just learning Java, stick with applications. They are much easier to deal with. In any case, building a Swing GUI must be done on the Event Dispatch Thread (EDT). To do that you need to use EventQueue.invokeLater() to wrap all your calls that create Swing GUI components. Applet.init() is not running on the EDT. Example; public class MyApplet extends JApplet { public void init() { EventQueue.invokeLater(() -> { JTextArea area = new JTextArea("area"); add(area); }); } } So the above code does run but with all the discussed caveats. knute... On 9/15/2015 17:07, SpreadTooThin wrote: > I tried writing a small applet that used swing. > However when I try to run it in my browswer, (firefox, chrome) I get a message saying > "This plugin is not supported." > > It's a really simple swing listbox.... > > > // This is the html file > > > "my dpa class" > > > > > > > // This is the java file which i compiled into a class... > import javax.swing.JApplet; > import javax.swing.JTextArea; > > public class dpa extends JApplet { > @Override > public void init() { > JTextArea area = new JTextArea("Hello World"); > this.add(area); > } > } > > What have I done wrong? > I looked for some security setting but maybe I'm missing something more fundamental. > > -- Knute Johnson