Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32588 > unrolled thread

Applets?

Started bySpreadTooThin <bjobrien62@gmail.com>
First post2015-09-15 17:07 -0700
Last post2015-09-16 21:16 -0400
Articles 7 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Applets? SpreadTooThin <bjobrien62@gmail.com> - 2015-09-15 17:07 -0700
    Re: Applets? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-09-15 17:56 -0700
    Re: Applets? Jeff Higgins <jeff@invalid.invalid> - 2015-09-15 21:00 -0400
      Re: Applets? SpreadTooThin <bjobrien62@gmail.com> - 2015-09-16 07:21 -0700
        Re: Applets? e.d.programmer@gmail.com - 2015-09-16 07:28 -0700
        Re: Applets? Arne Vajhøj <arne@vajhoej.dk> - 2015-09-16 21:10 -0400
        Re: Applets? Arne Vajhøj <arne@vajhoej.dk> - 2015-09-16 21:16 -0400

#32588 — Applets?

FromSpreadTooThin <bjobrien62@gmail.com>
Date2015-09-15 17:07 -0700
SubjectApplets?
Message-ID<a3f016f7-b5fa-4c80-8cb0-5ebf0a533298@googlegroups.com>
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
<html>
	<head>
		<title>"my dpa class"</title>
	</head>
	<body>
		<applet code="dpa.class" widht="45" height="100"></applet>
	</body>
</html>

// 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.
 

[toc] | [next] | [standalone]


#32589

FromKnute Johnson <nospam@rabbitbrush.frazmtn.com>
Date2015-09-15 17:56 -0700
Message-ID<mtaeks$mbq$1@dont-email.me>
In reply to#32588
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
> <html>
> 	<head>
> 		<title>"my dpa class"</title>
> 	</head>
> 	<body>
> 		<applet code="dpa.class" widht="45" height="100"></applet>
> 	</body>
> </html>
>
> // 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

[toc] | [prev] | [next] | [standalone]


#32590

FromJeff Higgins <jeff@invalid.invalid>
Date2015-09-15 21:00 -0400
Message-ID<mtaetn$n5c$1@dont-email.me>
In reply to#32588
On 09/15/2015 08:07 PM, 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."

To run your applet outside a browser, see:
appletviewer
<http://docs.oracle.com/javase/8/docs/technotes/tools/windows/appletviewer.html>

For information on enabling a Java plugin for your browser
see your browser's manual.

Chrome no longer supports NPAPI
<https://java.com/en/download/faq/chrome.xml>

[toc] | [prev] | [next] | [standalone]


#32591

FromSpreadTooThin <bjobrien62@gmail.com>
Date2015-09-16 07:21 -0700
Message-ID<78ead945-71d8-4605-a992-e93168b39d11@googlegroups.com>
In reply to#32590
> To run your applet outside a browser, see:
> appletviewer
> <http://docs.oracle.com/javase/8/docs/technotes/tools/windows/appletviewer.html>
> 
> For information on enabling a Java plugin for your browser
> see your browser's manual.
> 
> Chrome no longer supports NPAPI
> <https://java.com/en/download/faq/chrome.xml>

This indeed seems to be the Issue... NPAPI is no longer supported..
What does Chrome expect developers to develop in?
Go?

[toc] | [prev] | [next] | [standalone]


#32592

Frome.d.programmer@gmail.com
Date2015-09-16 07:28 -0700
Message-ID<ac4a3f56-f478-4ce3-ae2b-d7d56486be7c@googlegroups.com>
In reply to#32591
On Wednesday, September 16, 2015 at 10:21:25 AM UTC-4, SpreadTooThin wrote:
> > To run your applet outside a browser, see:
> > appletviewer
> > <http://docs.oracle.com/javase/8/docs/technotes/tools/windows/appletviewer.html>
> > 
> > For information on enabling a Java plugin for your browser
> > see your browser's manual.
> > 
> > Chrome no longer supports NPAPI
> > <https://java.com/en/download/faq/chrome.xml>
> 
> This indeed seems to be the Issue... NPAPI is no longer supported..
> What does Chrome expect developers to develop in?
> Go?

Read all about it.
https://www.chromium.org/developers/npapi-deprecation

[toc] | [prev] | [next] | [standalone]


#32597

FromArne Vajhøj <arne@vajhoej.dk>
Date2015-09-16 21:10 -0400
Message-ID<mtd3u9$dek$1@speranza.aioe.org>
In reply to#32591
On 9/16/2015 10:21 AM, SpreadTooThin wrote:
>> To run your applet outside a browser, see:
>> appletviewer
>> <http://docs.oracle.com/javase/8/docs/technotes/tools/windows/appletviewer.html>
>>
>> For information on enabling a Java plugin for your browser
>> see your browser's manual.
>>
>> Chrome no longer supports NPAPI
>> <https://java.com/en/download/faq/chrome.xml>
>
> This indeed seems to be the Issue... NPAPI is no longer supported..
> What does Chrome expect developers to develop in?

For code running browser side?

What is somewhat misleading known as "HTML5" and consist of HTML+CSS+JS.

Arne

[toc] | [prev] | [next] | [standalone]


#32598

FromArne Vajhøj <arne@vajhoej.dk>
Date2015-09-16 21:16 -0400
Message-ID<mtd498$e3j$1@speranza.aioe.org>
In reply to#32591
On 9/16/2015 8:59 PM, Stefan Ram wrote:
> SpreadTooThin <bjobrien62@gmail.com> writes:
>> What does Chrome expect developers to develop in?
>> Go?
>
>    What problem do you want to solve with applets?
>
>    Well, ...
>
>    One one hand¹, everybody says applets are dead.
>    (Already years ago, everybody told me so.)
>
>    One the other hand, the most recent »The Java EE 7 Tutorial«
>    from 2014 says:
>
>        »The Java EE specification defines the following Java EE
>        components:
>
>                *  Application clients and applets are components
>                   that run on the client. ¯¯¯¯¯¯¯
>
>                *  Java Servlet, JavaServer Faces, and JavaServer
>                   Pages (JSP) technology components are web
>                   components that run on the server.«,
>
>    as if applets where alive!
>
>    Applets do not seem to work on the internet anymore,
>    but possibly in some intranets.

Those application clients must be EJB clients outside of app server.

And in that context Java applications and Java applets are the
available options.

Native apps, .NET apps, Flash, SilverLight, JavaScript etc. are
not options as they can not make EJB calls.

The facts that EJB clients outside of app server and Java applets are
both very rare today does not make them non-options.

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web