How to implement this app in a web browser?

N

news reader

Hello,
Complete newbie here.
How do you get the following application to run in a web browser?

myapp.jar
myappcommoncommons.jar
myappchartcomp.jar

classes\mycompany\chart
MyappChart.class

classes\mycompany\gui
Main.class
Main_AboutBox.class
Main_jMenuFileExit_ActionAdapter.class
Main_jMenuFileOpen_ActionAdapter.class
Main_jMenuHelpAbout_ActionAdapter.class
Main_plotButton_mouseAdapter.class
Monitor.class

classes\mycompany\metrics
MyappMetricManager.class
MyappMetrics.class

classes\mycompany\util
DateUtil.class


I've found this web page:
http://java.sun.com/docs/books/tutorial/deployment/jar/run.html
and have tried embedding the main JAR of our application as follows:

<html>
<body>
<applet code="classes/mycompany/gui/Main.class"
archive="myapp.jar"
width=100% height=90%>
</applet>
</html>

but this fails miserably!
How do you direct the browser to handle multiple classes? Or do I need to?
How about the alternate JARs?
I would really appreciate your knowledgeable input!

Thank you very much!
 
A

Arne Vajhøj

news said:
Hello,
Complete newbie here.
How do you get the following application to run in a web browser?

myapp.jar
myappcommoncommons.jar
myappchartcomp.jar

classes\mycompany\chart
MyappChart.class

classes\mycompany\gui
Main.class
Main_AboutBox.class
Main_jMenuFileExit_ActionAdapter.class
Main_jMenuFileOpen_ActionAdapter.class
Main_jMenuHelpAbout_ActionAdapter.class
Main_plotButton_mouseAdapter.class
Monitor.class

classes\mycompany\metrics
MyappMetricManager.class
MyappMetrics.class

classes\mycompany\util
DateUtil.class


I've found this web page:
http://java.sun.com/docs/books/tutorial/deployment/jar/run.html
and have tried embedding the main JAR of our application as follows:

<html>
<body>
<applet code="classes/mycompany/gui/Main.class"
archive="myapp.jar"
width=100% height=90%>
</applet>
</html>

but this fails miserably!
How do you direct the browser to handle multiple classes? Or do I need to?
How about the alternate JARs?
I would really appreciate your knowledgeable input!

First thing is to change from application to applet !

Arne
 
N

news reader

Knute Johnson said:

Dear Knute,

Does that mean I would need to make a JNLP file (a .xml file) as per that
page?

My application has the following structure:

The main application is

myapp.jar

The application comes with two other jars in its root folder

myappcommoncommons.jar
myappchartcomp.jar

The following classes would need to be included

classes/mycompany/chart/MyappChart.class
classes/mycompany/gui/Main.class
classes/mycompany/gui/Main_AboutBox.class
classes/mycompany/gui/Main_jMenuFileExit_ActionAdapter.class
classes/mycompany/gui/Main_jMenuFileOpen_ActionAdapter.class
classes/mycompany/gui/Main_jMenuHelpAbout_ActionAdapter.class
classes/mycompany/gui/Main_plotButton_mouseAdapter.class
classes/mycompany/gui/Monitor.class
classes/mycompany/metrics/MyappMetricManager.class
classes/mycompany/metrics/MyappMetrics.class
classes/mycompany/util/DateUtil.class

Would they be noted in multiple <jar href="lib/filename.jar"/> clauses?
(Can you put .class files there?)

Thank you very much.
 
K

Knute Johnson

news said:
Dear Knute,

Does that mean I would need to make a JNLP file (a .xml file) as per that
page?
Yes

My application has the following structure:

The main application is

myapp.jar

The application comes with two other jars in its root folder

myappcommoncommons.jar
myappchartcomp.jar

The following classes would need to be included

These classes will need to be put into a .jar file.
classes/mycompany/chart/MyappChart.class
classes/mycompany/gui/Main.class
classes/mycompany/gui/Main_AboutBox.class
classes/mycompany/gui/Main_jMenuFileExit_ActionAdapter.class
classes/mycompany/gui/Main_jMenuFileOpen_ActionAdapter.class
classes/mycompany/gui/Main_jMenuHelpAbout_ActionAdapter.class
classes/mycompany/gui/Main_plotButton_mouseAdapter.class
classes/mycompany/gui/Monitor.class
classes/mycompany/metrics/MyappMetricManager.class
classes/mycompany/metrics/MyappMetrics.class
classes/mycompany/util/DateUtil.class

Would they be noted in multiple <jar href="lib/filename.jar"/> clauses?
Yes

(Can you put .class files there?)
No

Thank you very much.

You are welcome. JNLP files can get very complicated and have lots of
options. Deploying an applet is simpler in some ways but it must be
written as an applet. Remember that both applets and JWS applications
are run in the sandbox and cannot write to disk or contact servers other
than the one they were loaded from without being signed.

There are some simple applets and JWS applications on my Java demo web
site, http://rabbitbrush.frazmtn.com. The source code is there but not
the JNLP files. I'll go edit my web site to add them so you can see
these simple examples.
 
R

Roedy Green

myapp.jar
myappcommoncommons.jar
myappchartcomp.jar

When you have multiple jars, it is easier and more efficient to use
Java Web Start than an Applet. JWS will cache the jars for reuse.

See http://mindprod.com/jgloss/javawebstart.html
http://mindprod.com/jgloss/jnlp.html

The disadvantage is JNLP supports Applets only recently. Your users
will need a recent JRE.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Don’t worry about where you are. Watch the first derivative."
translation:
"Don’t worry about how things are. Watch where they are headed."
~ Fred Green (born: 1913-07-12 died: 1992-04-10 at age: 78) (my Dad, an electrical engineer)
 
J

John B. Matthews

[...]
There are some simple applets and JWS applications on my Java demo web
site, http://rabbitbrush.frazmtn.com. The source code is there but not
the JNLP files. I'll go edit my web site to add them so you can see
these simple examples.

Alternatively, many browsers have a preference to save downloaded files,
which makes study easier. For example:

Safari: Uncheck "Open 'safe' files after downloading."
Firefox: Click "Save files to [Downloads]."

The JOGL Demos are a good source for more elaborate examples:

<http://download.java.net/media/jogl/demos/www/>

It looks like the project has a new home page:

<http://kenai.com/projects/jogl/pages/Home>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top