Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

applets won't appear

10 views
Skip to first unread message

thewhoracle

unread,
May 16, 2005, 4:20:57 PM5/16/05
to
I cannot get even a simple HelloWorld Applet to display on my firefox
or IE if I am the one who coded it. I know it's not my Java code
because i even tried putting other example applets on my page and they
still won't appear. this is driving me absolutely nuts.
I built the HelloWorld.class applet in NetBeans 4.0 and I am using
java 2 v1.4.2 SDK.

here's the code i use to append the applet to the page.

<HTML>
<HEAD>
<TITLE>HelloWorld (1.6)</TITLE>
</HEAD>
<BODY>

<!--"CONVERTED_APPLET"-->


<!-- HTML CONVERTER -->
<OBJECT
classid =" clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA"

codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0"
WIDTH = 170 HEIGHT = 150 >
<PARAM NAME = "code" value = "HelloWorld.class" >
<PARAM name="type"
value="application/x-java-applet;jpi-version=1.4.2">
<PARAM NAME ="scriptable" VALUE ="false">

<COMMENT>
<EMBED
type =" application/x-java-applet;version=1.4.2" \
CODE =" HelloWorld.class" \
WIDTH = 170 \
HEIGHT = 150 \
scriptable = false \
pluginspage ="
http://java.sun.com/products/plugin/index.html#download">
<NOEMBED>
alt="Your browser understands the &lt;APPLET&gt; tag but
isn't running the applet, for some reason."
Your browser is completely ignoring the &lt;APPLET&gt; tag!
</NOEMBED>

</EMBED>
</COMMENT>
</OBJECT>

<!--
<APPLET CODE = "HelloWorld.class" WIDTH = 170 HEIGHT = 150>
alt="Your browser understands the &lt;APPLET&gt; tag but isn't running
the applet, for some reason."
Your browser is completely ignoring the &lt;APPLET&gt; tag!

</APPLET>
-->


<!--"END_CONVERTED_APPLET"-->

</BODY>
<script language="JavaScript"
src="/js/omi/jsc/s_code_remote.js"></script></html>

someone please help?

Kenneth Turvey

unread,
May 16, 2005, 4:08:50 PM5/16/05
to
On 16 May 2005 13:20:57 -0700, thewhoracle <cst...@ithaca.edu> wrote:
> I cannot get even a simple HelloWorld Applet to display on my firefox
> or IE if I am the one who coded it. I know it's not my Java code
> because i even tried putting other example applets on my page and they
> still won't appear. this is driving me absolutely nuts.
> I built the HelloWorld.class applet in NetBeans 4.0 and I am using
> java 2 v1.4.2 SDK.
>
> here's the code i use to append the applet to the page.

You are probably running a version of the plugin that is lower than the
version of the JDK you used to compile your applet. Try using the
-source and -target options when you compile your applet. For example:

javac -source 1.3 -target 1.3 helloworld/HelloWorld.java

I don't know if JDK 1.4.2 has the -source flag, so you might just have
this:

javac -target 1.3 helloworld/HelloWorld.java

or similar. I'm assuming your HelloWorld class is in the package
helloworld. You might just have this:

javac -target 1.3 HelloWorld.java

You need to target a version of Java that is less than or equal to the
verion your browser supports.

--
Kenneth P. Turvey <ktu...@scu.net>
--------------------------------------------------------
IDIOT, n - A member of a large and powerful tribe whose influence in
human affairs has always been dominant and controlling.
-- Ambrose Bierce

Lothar Leidner

unread,
May 17, 2005, 4:25:59 AM5/17/05
to
Don't convert the html file. Just use the applet tag and it will work.

Regards,

Lothar Leidner

thewhoracle wrote:
> <APPLET CODE = "HelloWorld.class" WIDTH = 170 HEIGHT = 150>

> </APPLET>

Andrew Thompson

unread,
May 19, 2005, 2:54:01 PM5/19/05
to
On Tue, 17 May 2005 10:25:59 +0200, Lothar Leidner wrote:

> thewhoracle wrote:
>> <APPLET CODE = "HelloWorld.class" WIDTH = 170 HEIGHT = 150>
>> </APPLET>

> Don't convert the html file. Just use the applet tag and it will work.

Good suggestion, but I recommend you tidy up that applet element first.

The most important things missing are the 'alt' and 'no applet' parts.

This is what I suggest instead..

<applet
code='HelloWorld.class'
width=170
height=150
alt='This applet requires Java enabled!'>
<p>This page requires the Java Plug-In (available free from Sun)
</applet>

People with no Java get the last message. People who have Java
installed but disabled get the first message.

If your applet still does not work..
- Upload all the files to GeoCities (or another free site)
- Drop us the link, ..and while you are at it, ..
- Find the Java console in your browser, as that gives better information
on why your applets fail.

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane

thewhoracle

unread,
May 25, 2005, 10:38:36 AM5/25/05
to
Hm you've answered most of my questions on here, thank you so much.
I'm learning java at a pace that has me saying things a majority of
sailors would avoid saying. So here's the thing, I changed the
JApplet aLOT. I programmed it in Eclipse 3.02, it uses multiple
classes and threading and whatnot, and I <i>cannot</i> get it to
display on an html i have locally stored. I tried netscape firefox and
IE. i have 3 .classes. i need to know specifically
-where these have to be in relation to each other/the html file
-how to include them with the applet tag
-do i need to embed them or use the object tag
I am like a child has wandered into a movie theater, i have no idea of
any of these. get back to me please.

Andrew Thompson

unread,
May 25, 2005, 11:11:12 AM5/25/05
to
On 25 May 2005 07:38:36 -0700, thewhoracle wrote:

> I'm learning java at a pace that has me saying things a majority of
> sailors would avoid saying. So here's the thing, I changed the
> JApplet aLOT.

Combining applets, swing and learning Java is possibly a
recipe for madness.
<http://www.physci.org/codes/javafaq.jsp#appfirst>

>..I programmed it in Eclipse 3.02,

..and using an IDE.
<http://qa.jtiger.org/GetQAndA.action?qids=52&showAnswers=true&showCodeLineNumbers=true&showCodeBorder=true&codeStyle=>

<dripping with sarcasm>
Any of those dang 'learning using an IDE is much better' folks
prepared to leap forward and tell us what button to press in Eclipse?
</dripping with sarcasm>

>..it uses multiple classes and threading and whatnot, ..

Change 'possibly' above to 'definitely'.

>.. and I <i>cannot</i> get it to


> display on an html i have locally stored. I tried netscape firefox and
> IE.

As I have mentioned before <louder this time>YOU NEED TO
FIND THE CONSOLES</louder this time>. They tell you 'whatnot'.
The specific 'whatnot' being the reason the applet failed.

In this case I suspect the JVM is not even finding the classes,
but that is much easier to tell from looking at the web page,
since then I can work out where the page is looking for the
class by looking at the <HTML> code.

>..i have 3 .classes. i need to know specifically


> -where these have to be in relation to each other/the html file
> -how to include them with the applet tag
> -do i need to embed them or use the object tag
> I am like a child has wandered into a movie theater, i have no idea of
> any of these. get back to me please.

Why don't you get back to me with the URL of the (broken) page you
have uploaded to Geocities. Use an applet tag to attempt to load a
-single- class. Try this exact example.

</sscce>
public class HelloWorldApplet
extends java.applet.Applet {
public void init() {
add( new java.awt.Label("Hi!") );
}
}
</sscce>

Here is the web page that loads it.
____________________________________________________
<HTML><HEAD></HEAD><BODY>
<APPLET
CODE="HelloWorldApplet.class"
CODEBASE="."
WIDTH=100
HEIGHT=50></APPLET>
</BODY></HTML>
____________________________________________________
The .class file and HTML should be put in the same directory
for this example to work.

See if you can get that to work before you go any further,
and upload all the files (including source) to a free site
if you cannot.

Thomas Weidenfeller

unread,
May 25, 2005, 11:37:54 AM5/25/05
to
Andrew Thompson wrote:
> On 25 May 2005 07:38:36 -0700, thewhoracle wrote:
>>..I programmed it in Eclipse 3.02,
>
>
> ..and using an IDE.
> <http://qa.jtiger.org/GetQAndA.action?qids=52&showAnswers=true&showCodeLineNumbers=true&showCodeBorder=true&codeStyle=>

Did you recognize that the OP previously wrote that he used NetBeans
4.0? So he is also cycling through IDEs, burning brain cycles in trying
to tame and understand different IDEs. Oh dear, oh dear :-(

To the OP: Start Simpler!

- A text editor of your choice. Or, if you are already used to a
particular programming editor, that particular editor.

- The JDK.

- A local installation of the JDK's JavaDoc API documentation (and a Web
browser to read it)

Then:

- Build simple applications, not Applets, not GUI applictions.


And,

- If the first application runs, *and* if you can handle it, *and* you
already understand how these things work: a build tool (to save typing
the same compilation comand line again and again). If you don't know
such a tool, use simple batch/shell scripts for a start.

/Thomas

Andrew Thompson

unread,
May 25, 2005, 11:47:57 AM5/25/05
to
On Wed, 25 May 2005 17:37:54 +0200, Thomas Weidenfeller wrote:

> Did you recognize that the OP previously wrote that he used NetBeans
> 4.0? So he is also cycling through IDEs, burning brain cycles in trying
> to tame and understand different IDEs. Oh dear, oh dear :-(

LOL - yeah! I noticed that just moments before I saw your post
and was about to recheck my facts. (sigh)

thewhoracle

unread,
May 25, 2005, 11:56:14 AM5/25/05
to
ok, so i know java and eclipse fairly well as far as standalone
programming. I actually programmed Clue with 6 players networked from
the ground up last year, but the applet thing is a totally different
animal, what with concurrencies and whatnot. Using Netbeans was more
an experiment than a definite choice. This JApplet works fine within
Eclipse, and i reduced/commented it so it only uses the one displaying
class, and it still won't appear. The 'Hello World' does. The url for
mine is http://www.geocities.com/ready_sunset_windmills/TEST.html
and yours is """"""/TEST2.html
if you need access to my account, the temporary password for today is
"turtle"

Andrew Thompson

unread,
May 25, 2005, 12:33:41 PM5/25/05
to
On 25 May 2005 08:56:14 -0700, thewhoracle wrote:

> ok, so i know java and eclipse fairly well as far as standalone
> programming. I actually programmed Clue with 6 players networked from
> the ground up last year, but the applet thing is a totally different

> animal, what with concurrencies ...

'concurrencies'? What does that mean to you? It means little to me.

> ..and whatnot.

(grimaces) I was trying to hint to you (all subtle like) that
I detest hearing words like 'whatnot' in technical discussions.

In future, please tack down 'whatnot' to specific technical terms
and exact error reports.

>..Using Netbeans was more an experiment than a definite choice.

...hmmm. Dump them all and take Thomas' advice if you are serious.

While you may be convinced you know Java well, I would suggest you
could ask more specific and directed questions if you did.

>...This JApplet ..

Can we stop talking about the multi-class JApplet for a moment?
I am not suggesting helping you with that. That is about two or three
steps advanced on what you should be approaching at this moment. [1]

>...works fine within


> Eclipse, and i reduced/commented it so it only uses the one displaying
> class, and it still won't appear.

???

>..The 'Hello World' does.

[1] Oh, wait, you DID get that working first. OK. [2]

>..The url for


> mine is http://www.geocities.com/ready_sunset_windmills/TEST.html
> and yours is """"""/TEST2.html

[2] Alright.. against my better judgement I will spoonfeed you a
little today. This is what Opera's Java console reports..

java.lang.NoClassDefFoundError: MyFileFilter
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
......

If MyFileFilter.class has no package statement, like tryapplet.class,
it needs to be here..
<http://www.geocities.com/ready_sunset_windmills/MyFileFilter.class>

It is not there - I checked. [ Whereas
<http://www.geocities.com/ready_sunset_windmills/tryapplet.class>
gets a download dialog on Mozilla, the other URL produces a 404
'not found' page. )

> if you need access to my account,

Don't give out your account password on usenet, even a temporary one!
You might be surprised to find federal authorities at your door
wanting to know why child pornography was being served off your site.

Just put links in the web page to the files.

>...the temporary password for today is
> "....."

Please change your password immediately.

And consider carefully the advice to dump the IDE(s) for the
moment, they are simply getting in the way.

Thomas Fritsch

unread,
May 25, 2005, 1:08:51 PM5/25/05
to
When testing http://www.geocities.com/ready_sunset_windmills/TEST.html I
got the same
java.lang.NoClassDefFoundError: MyFileFilter
...
in the Java-Console as Andrew has already reported.

BTW: When looking in your decompiled tryapplet.class I saw that it uses
some anonymous inner classes, which you may or may not have uploaded
yet. So please make sure that these files are uploaded, too. They have
file names like "tryapplet$1.class", "tryapplet$2.class", ...

--
"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')

thewhoracle

unread,
May 25, 2005, 2:25:46 PM5/25/05
to
Ok, so geocities doesn't support the upload of files with $ in the
name, so either i have to redefine what the inner classes are named
inside my program or shove them into a .jar. which is easier/safer and
what is the best way to go about them?

thewhoracle

unread,
May 25, 2005, 2:45:53 PM5/25/05
to
Ok so I put all the aforementioned files in a folder on my desktop and
ran the html file off my website and the JApplet initiaties and starts
but then displays nothing and my console spits back THIS. I can't put
my stuff online because yahoo doesn't accept $ in a filename. do i
need a different tag for including it on the site? or a .jar?


Java Plug-in 1.5.0_02
Using JRE version 1.5.0_02 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\clayton


----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

Exception in thread "AWT-EventQueue-2"
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.dir read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.io.Win32FileSystem.getUserPath(Unknown Source)
at java.io.Win32FileSystem.resolve(Unknown Source)
at java.io.File.getAbsolutePath(Unknown Source)
at sun.awt.shell.Win32ShellFolder2.<init>(Unknown Source)
at sun.awt.shell.Win32ShellFolder2.listFiles(Unknown Source)
at sun.awt.shell.ShellFolder.listFiles(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
at sun.awt.shell.ShellFolder.get(Unknown Source)
at
javax.swing.plaf.metal.MetalFileChooserUI.updateUseShellFolder(Unknown
Source)
at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(Unknown
Source)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JFileChooser.updateUI(Unknown Source)
at javax.swing.JFileChooser.setup(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at tryapplet.makeGUI(tryapplet.java:104)
at tryapplet$1.run(tryapplet.java:50)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3"
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.dir read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.io.Win32FileSystem.getUserPath(Unknown Source)
at java.io.Win32FileSystem.resolve(Unknown Source)
at java.io.File.getAbsolutePath(Unknown Source)
at sun.awt.shell.Win32ShellFolder2.<init>(Unknown Source)
at sun.awt.shell.Win32ShellFolder2.listFiles(Unknown Source)
at sun.awt.shell.ShellFolder.listFiles(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
at sun.awt.shell.ShellFolder.get(Unknown Source)
at
javax.swing.plaf.metal.MetalFileChooserUI.updateUseShellFolder(Unknown
Source)
at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(Unknown
Source)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JFileChooser.updateUI(Unknown Source)
at javax.swing.JFileChooser.setup(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at tryapplet.makeGUI(tryapplet.java:104)
at tryapplet$1.run(tryapplet.java:50)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

thewhoracle

unread,
May 25, 2005, 2:54:22 PM5/25/05
to
AND (sorry), when the applet does start, i can see the correct shape
window appear but then a huge grey ractangle blocks it out. there.
let me know where i went wrong. i'm so close it hurts.

thewhoracle

unread,
May 25, 2005, 3:06:06 PM5/25/05
to
Sorry if it seems i'm jumping in. this is for my business.
'concurrencies' meant 'compatibility issues', just a typo. I am
trying what you both suggested, but another question is, should i
shove all these .class's into a .jar file and if so what is the best
way to do it?

thanks for your patience.

Thomas Fritsch

unread,
May 25, 2005, 6:04:01 PM5/25/05
to
"thewhoracle" <twocent...@gmail.com> wrote in
news:1117045546.9...@o13g2000cwo.googlegroups.com...

> Ok, so geocities doesn't support the upload of files with $ in the
> name, so either i have to redefine what the inner classes are named
> inside my program ...

You can't. There is no way to tell the java-compiler how to name the
anonymous inner classes.

> ... or shove them into a .jar. which is easier/safer and


> what is the best way to go about them?
>

I recommend you bundle all your classes into a jar file. This will simplify
manual uploading greatly.
See http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html for
details.

And of course you have to add an archive-parameter to the applet tag in your
HTML file.
See http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html for details.

--
"TFritsch$t-online:de".replace(':','.').replace('$','@')


thewhoracle

unread,
May 25, 2005, 9:05:06 PM5/25/05
to
it's still not showing. can you think of any othe reason that'd happen?

Andrew Thompson

unread,
May 25, 2005, 10:28:43 PM5/25/05
to
On 25 May 2005 12:06:06 -0700, thewhoracle wrote:

> ..should i


> shove all these .class's into a .jar file

Yes. While it is possible to upload all the class files separately
(sites that bar filenames containing '$' notwithstanding), it is much
easier to upload them as a aingle .jar file.

>.. and if so what is the best way to do it?

The best way to do it is using the jar command
<http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/jar.html>
But a 'quick and dirty' tip is that for an unsigned applet, using
WinZip is slightly quicker (make a Zip file - at standard compresssion,
then rename it to .jar. Voila!)

OTOH, I noticed you posted a stack trace earlier, that started..

Exception in thread "AWT-EventQueue-2"
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.dir read)

I know roughly what you are attempting to do, why it is failing,
and what needs to be done to prevent it failing (on that count).
Research the AccessControlException in the JavaDocs and see if
-you- can work out why it failed.

thewhoracle

unread,
May 26, 2005, 10:17:04 AM5/26/05
to
The only thing i can figure out is i have to either sign my JApplet,
or set my security policy in some way. I don't know how to do the
second but the first i am working on now

Andrew Thompson

unread,
May 26, 2005, 11:49:14 AM5/26/05
to
On 26 May 2005 07:17:04 -0700, thewhoracle wrote:

> The only thing i can figure out is i have to either sign my JApplet,
> or set my security policy in some way.

Got it in one.

>..I don't know how to do the second ..

Changing the security policy is not really a suitable option
for anything but testing, or an applet that only has a handful
of users.

>..but the first i am working on now

It is a steep learning curve, but well worth it.

A tip that most people miss. You can make a 'self-signed' certificate
without any 'root' certificate (read cost) from Thawte or VeriSign.

Thomas Fritsch

unread,
May 26, 2005, 12:18:59 PM5/26/05
to
"thewhoracle" <twocent...@gmail.com> schrieb im Newsbeitrag
news:1117069506.6...@z14g2000cwz.googlegroups.com...

> it's still not showing. can you think of any othe reason that'd happen?
>
Sorry, without further information I can't.

When re-testing with your URL
http://www.geocities.com/ready_sunset_windmills/TEST.html
I still get
java.lang.NoClassDefFoundError: tryapplet$1
at tryapplet.init(tryapplet.java:48)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
in the Java-Console.
So please upload your jar file and your modified TEST.html (as described in
my previous post),
and we'll see what went wrong.

thewhoracle

unread,
May 26, 2005, 12:18:59 PM5/26/05
to
my .jar file is going up now, unsigned.

Andrew Thompson

unread,
May 26, 2005, 12:38:03 PM5/26/05
to
On 26 May 2005 09:18:59 -0700, thewhoracle wrote:

> my .jar file is going up now, unsigned.

The class is now apparently being found and we are back to the
AccessControlException (as expected for the unsigned jar attempting
to ascertain the user.dir - ..but isn't user.home more useful for
most purposes?).

Thomas Fritsch

unread,
May 26, 2005, 1:53:23 PM5/26/05
to
"thewhoracle" <twocent...@gmail.com> wrote in
news:1117124339.5...@o13g2000cwo.googlegroups.com...

> my .jar file is going up now, unsigned.
>
Thanks. Now I get

Exception in thread "AWT-EventQueue-2"
java.security.AccessControlException: access denied
(java.util.PropertyPermission user.dir read)
...

at javax.swing.JFileChooser.<init>(Unknown Source)
at tryapplet.makeGUI(tryapplet.java:104)
at tryapplet$1.run(tryapplet.java:50)
...

After having read the other messages of this thread I saw you already posted
that exception earlier [ deeply branched news threads are so confusing ;-) ]
and Andrew has already kicked you into the right direction to solve that
problem.

good luck

thewhoracle

unread,
May 26, 2005, 3:35:29 PM5/26/05
to
thanks. i don't know what the user.dir is all about, but i'll be
self-signing the applet tonight. thanks guys

thewhoracle

unread,
May 26, 2005, 3:41:55 PM5/26/05
to
actually i lied i need to sign it through verisign or something.
anyone know an easy step by step walkthrough of this process?

Thomas Fritsch

unread,
May 26, 2005, 6:43:56 PM5/26/05
to
"thewhoracle" <twocent...@gmail.com> wrote in
news:1117136515.6...@f14g2000cwb.googlegroups.com...

> actually i lied i need to sign it through verisign or something.
> anyone know an easy step by step walkthrough of this process?
>
This link should help: http://mindprod.com/jgloss/signedapplets.html

Frances Del Rio

unread,
Aug 15, 2005, 5:42:12 PM8/15/05
to
Andrew Thompson wrote:
> On 25 May 2005 07:38:36 -0700, thewhoracle wrote:
>
>
>>I'm learning java at a pace that has me saying things a majority of
>>sailors would avoid saying. So here's the thing, I changed the
>>JApplet aLOT.
>
>
> Combining applets, swing and learning Java is possibly a
> recipe for madness.
> <http://www.physci.org/codes/javafaq.jsp#appfirst>

hmmm.. scary.... by this you mean little swing stand-alone's you can
pop from command line?

well, I have a lot to learn.. specif. whether all the GUI stuff I'm
reading about in this java book I have (and other sources) re mainly
Component, JComponent, etc.. apply only to stand-alone (or desktop)
GUI's or applets also..


Andrew Thompson

unread,
Aug 16, 2005, 3:05:07 AM8/16/05
to
On Mon, 15 Aug 2005 17:42:12 -0400, Frances Del Rio wrote:
> Andrew Thompson wrote:
>> On 25 May 2005 07:38:36 -0700, thewhoracle wrote:
>>
>>>I'm learning java at a pace that has me saying things a majority of
>>>sailors would avoid saying. So here's the thing, I changed the
>>>JApplet aLOT.
>>
>> Combining applets, swing and learning Java is possibly a
>> recipe for madness.
>> <http://www.physci.org/codes/javafaq.jsp#appfirst>
>
> hmmm.. scary.... by this you mean little swing stand-alone's you can
> pop from command line?

No. I actually mean little CLI* stand-alones that
you can run from the CLI. No GUI at all.

* Command Line Interface.

1) Imagine you were writing a class that you needed to
call from a servlet in a headless environment.

Once you had that class working, you could use it in
a servlet, or an applet, or a (J)Frame, (J)Window, the
command line, Ant, via RMI...

A CLI based class is much more versatile.

But more important to debugging.

2) The layers of complexity inherent in (first) GUI'd
applications, then a mixture of applets and server side
development, raises the debugging effort an order of magnitude.
There are problems you have been solving in an applet in a
JSP where I would have sorted the problem back at the CLI.

Can you understand why I get a little exasperated
when you ask why your applet, in an invalid JSP,
with typical 'Java Programmer' butchered JS
sprinkled throughout it, does not work as you expect?

Oh, and by the way.

I saw your post with the HTML. ..Some progress.

I have been trying to get some things across to you
by referring to them often (and sometimes indirectly).
That is apparently not working. I will try a
different tack.

If you would like me to examine a problem, please..

- Validate all HTML (or any result thereof) in the W3C
validator. Make sure it has *0* errors.
The one error identified in your current HTML might not be
causing any problem, but to be sure of that, I would need to
download the HTML (and classes) and fix the HTML to test it
locally. But, ..why should I, when you could validate it
yourself?

- Remove all JS. I can see you are still having trouble
figuring how to separate the JS at times, but I assure
you that it is both possible and (often) necessary.

- Remove the extraneous comments, *especially* any
Java code that you have commented out of the JSP!

- Don't presume the HTML you get. Look at it as
'Source' in a browser.

Oh, BTW - Good to see you are reading c.l.j.gui. :-)

Now, please validate/trim that HTML we were discussing
on c.l.j.help. ;-)

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Let us not talk falsely now, the hour is getting late." Bob Dylan 'All
Along The Watchtower'

Frances

unread,
Aug 16, 2005, 10:01:38 AM8/16/05
to

ok, Andrew, I have done everything you requested..

http://www.francesdelrio.com/chat/index.html

validates fine..

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.francesdelrio.com%2Fchat%2Findex.html
(and took out all JS and stuff that was bothering you..;)

so, back to my applet that won't load.. and I have a new question for
you here..

on that other one that you helped me out w/a little while ago
(http://www.francesdelrio.com/chat/pal.jsp) I now have also put applet
in jar, just to do a 'simple' version of what I'm trying to do (HAVE to
work w/in that smack package..) so did this:

<APPLET code="Palindrome.class" width=500 height=100
archive="Palindrome.jar">
(http://www.francesdelrio.com/chat/pal.jsp)

and this WORKS... passing params from form to applet and everything..

question: when I created this jar I buried palindrome.class under three
empty folders, to do it like it is in package I'm dealing with here..

so: path to CLASS is org\org2\org3\palindrome.class

yet in tag (which WORKS..) it only says code="Palindrome.class" how
does browser know where to find class?

(b/c I also tried code="org\org2\org3\palindrome.class" and it didn't
work.. so: based on this model that works, I have now done the following
in my index.html:

<APPLET archive="smack/smack.jar" CODE="achat.class" width=510 height=100>
</applet>

so how come this won't work?

so tried also these two:

<APPLET archive="smack/smack.jar"
CODE="org/jivesoftware/smack/achat.class" width=510 height=100>
</applet>

<APPLET archive="smack/smack.jar"
CODE="smack/org/jivesoftware/smack/achat.class" width=510 height=100>
</applet>

(all three of these in index.html now..)
(I also tried putting jar in same dir as index file (but: 1) it didn't
work either; and 2) don't know if it's ok to move a jar once you've
"jarred" it...;)
(this package comes w/ant build that does everything, don't know how to
tell it to put jar file where I want it, but that's fine, I can live
with having jar in one dir below index file..)

ok Andrew, I'm working very hard here and trying very hard, I need to
get this applet going and would appreciate your help very much.. thank
you.. Frances

Andrew Thompson

unread,
Aug 16, 2005, 10:10:57 AM8/16/05
to
On Tue, 16 Aug 2005 10:01:38 -0400, Frances wrote:

> <APPLET code="Palindrome.class" width=500 height=100
> archive="Palindrome.jar">
> (http://www.francesdelrio.com/chat/pal.jsp)
>
> and this WORKS... passing params from form to applet and everything..
>
> question: when I created this jar I buried palindrome.class under three
> empty folders, to do it like it is in package I'm dealing with here..

This is one of the reasons I demand URL's.

I just downloaded your jar and renamed it to .zip.
When I double clicked it, it opened in WinZip to reveal..
*2* copies of the class file. Examine it closely for
yourself and report back your conclusions.

[ I was actually checking to see if your IDE had specified
a main-class in the manifest! ]

"I'll sing and I'll be merry when occasion I do see,." Steeleye Span 'All
Around My Hat'

Frances Del Rio

unread,
Aug 16, 2005, 12:14:09 PM8/16/05
to
Andrew Thompson wrote:
> On Tue, 16 Aug 2005 10:01:38 -0400, Frances wrote:
>
>
>><APPLET code="Palindrome.class" width=500 height=100
>>archive="Palindrome.jar">
>>(http://www.francesdelrio.com/chat/pal.jsp)
>>
>>and this WORKS... passing params from form to applet and everything..
>>
>>question: when I created this jar I buried palindrome.class under three
>> empty folders, to do it like it is in package I'm dealing with here..
>
>
> This is one of the reasons I demand URL's.
>
> I just downloaded your jar and renamed it to .zip.
> When I double clicked it, it opened in WinZip to reveal..
> *2* copies of the class file. Examine it closely for
> yourself and report back your conclusions.
>
> [ I was actually checking to see if your IDE had specified
> a main-class in the manifest! ]

Jesus.. ok, I fixed it Andrew, it still works..
http://www.francesdelrio.com/chat/pal.jsp

(again, applet tag:


<APPLET code="Palindrome.class" width=500 height=100
archive="Palindrome.jar">

</applet>...)

but back to my applet which I'm having problem with..

http://www.francesdelrio.com/chat/index.html, which validates fine..

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.francesdelrio.com%2Fchat%2Findex.html

so, back to my applet that won't load..

<APPLET archive="smack/smack.jar" CODE="achat.class" width=510 height=100>
</applet>

<APPLET archive="smack/smack.jar"


CODE="org/jivesoftware/smack/achat.class" width=510 height=100>
</applet>

<APPLET archive="smack/smack.jar"
CODE="smack/org/jivesoftware/smack/achat.class" width=510 height=100>
</applet>

thank you very much for your help.. Frances


PS: one interesting thing about unzipping jars: when I convert
Palindrome.jar to a zip and I just double-click on it (I guess I have a
zip app that can do that, I hadn't realized..) it only shows class, but
you right-click on it and do "extract to here" you will see full
structure (i.e., org\org2\org3\Palindrome.class)


0 new messages