Applets

22 views
Skip to first unread message

mon3y

unread,
Jun 5, 2007, 11:19:57 AM6/5/07
to Google Web Toolkit
Hey guys

Ok so i need to implement a java applet into my GWT application.

This is not a ..."OoooO...its an applet", kinda requirement in my
project, its a "MUST HAVE requirement !!!"

I have searched the forums and googled it and mostly everyone is
having the same problem
That it gives you some funky error about, it can't find the applets
class file

This is how i call my applet

HTML msg = new HTML(
"<applet name = \"ReadTag\"" +
//"codebase = \"./\"" +
"code = \"package.ReadTagApplet.class\"" +
"width = 352" +
"height = 288" +
"</applet>", true);

Is there a special placement for the class file in my projects
package??
i'm running JRE1.6 in eclipse

Anyones 2c would be gr8
Smilies all round
:) :) :) :)

Scooter

unread,
Jun 5, 2007, 1:22:44 PM6/5/07
to Google Web Toolkit
The applet code needs to go in the xxx.xxx.public directory which is
at the same level as xxx.xxx.client that contains your primary gwt
application. Applets work without problem but will not work in hosted
mode. You will need to compile and then run in browser.

mon3y

unread,
Jun 6, 2007, 2:54:57 AM6/6/07
to Google Web Toolkit
Hey scooter

Thanx for the reply

I have basically stuck the ReadTagApplet.class in every single lvl of
my project and i get the same
problem

"Cannot load class sun/plugin/JavaRunTime

The bridge was intalled at <C:\Progra~1\Java\JRE16~1.0> but the class
is not there
Modify ther registry key to reflect the new bridge location
The key is HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in or change
your CLASSPATH to include the new directory...."

I have seen this error in other postings but without any
resolutions....

Any tips and advice?

Smilies all round
:) :) :) :)

> > :) :) :) :)- Hide quoted text -
>
> - Show quoted text -

Scooter

unread,
Jun 6, 2007, 6:54:25 AM6/6/07
to Google Web Toolkit
You can't run it in hosted mode using the google browser. Once you run
your application and you have the google browser in hosted mode you
then must select compile/browse to convert it to the deployable
javascript application. You then test in either IE or Firefox where
the applet can be loaded. The google browser in hosted mode is running
a java application to allow for debug etc. The java application can't
load an applet in the current design.

Scooter

unread,
Jun 6, 2007, 7:00:18 AM6/6/07
to Google Web Toolkit
If you run your application and you load the java applet as a first
step then you do have a problem where you will never be able to push
the compile/browse button on the hosted mode browser. You can add some
code that checks what port you are running on and not load the applet
and use this to catch that you are currently in hosted mode. You may
also be able to do the compile/browse step without running in hosted
mode.

The key is to build your gwt application and then run it in IE or
Firefox.

The applet portion of our application is important and it works well
in GWT but is not the primary gui element that loads first so I can
work around this problem.

For a quick demo of our gwt application see http://www.videoprotein.com/demo3min/Demo3.html
The video is done by a java applet.

Thanks

Scooter

mon3y

unread,
Jun 7, 2007, 3:39:34 AM6/7/07
to Google Web Toolkit
Thnx scooter

You are a life saver

Smilies all round
:) :) :) :)

On Jun 6, 1:00 pm, Scooter <willi...@gmail.com> wrote:
> If you run your application and you load the java applet as a first
> step then you do have a problem where you will never be able to push
> the compile/browse button on the hosted mode browser. You can add some
> code that checks what port you are running on and not load the applet
> and use this to catch that you are currently in hosted mode. You may
> also be able to do the compile/browse step without running in hosted
> mode.
>
> The key is to build your gwt application and then run it in IE or
> Firefox.
>
> The applet portion of our application is important and it works well
> in GWT but is not the primary gui element that loads first so I can
> work around this problem.
>

> For a quick demo of our gwt application seehttp://www.videoprotein.com/demo3min/Demo3.html

mon3y

unread,
Jun 8, 2007, 6:20:07 AM6/8/07
to Google Web Toolkit
Hey scooter

So it seemed to work and then i came to my desk the next day and boom,
it stopped working and gave me this error

java.lang.NoClassDefFoundError: ReadTagApplet (wrong name: net/impro/
ajax/reports/admin/server/readtag/ReadTagApplet)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

is this a java related error, or should i go to the java forums with
this?

my AJAX code is this


HTML msg = new HTML(
"<applet name = \"ReadTag\"" +

//"codebase = \"http://localhost:8080/quicktag/\"" +
"code = \"ReadTagApplet.class\"" +
"<param name=\"archive\" value=\"RReadTag.jar\" >"+


"width = 352" +
"height = 288" +
"</applet>", true);

Thnx


Smilies all round
:) :) :) :)

> > > > application.Appletswork without problem but will not work in hosted

Scooter

unread,
Jun 8, 2007, 7:43:10 AM6/8/07
to Google Web Toolkit
That is a java applet error and is probably related to not including
the jar file that contains the class in the applet. Nothing to do with
GWT.
Reply all
Reply to author
Forward
0 new messages