Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL in JEditorPane applet advice please

 
Billy Sclater
Ranch Hand
Posts: 145
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My basic goal is to open a JEditorPane in an applet, and then load that pane with a URL.
In the code I have chosen Yahoo.

When I run the applet it does nothing, just remains blank.

Can anyone give me some pointers?

 
Maneesh Godbole
Saloon Keeper
Posts: 11070
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add the JEditorPane instance to the applet
 
Billy Sclater
Ranch Hand
Posts: 145
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course! Thanks! Interesting though, this class with the 'jep.setPage("http://www.yahoo.com");' method needs to be signed to work.
My other class (you advised me on yesterday) didn't need to be signed with the context.showDocument("http://www.yahoo.com");

Is there anyway I can make this code work without signing the applet?
 
Maneesh Godbole
Saloon Keeper
Posts: 11070
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The showDocument delegates the call to the browser/applet viewer which is outside the security restrictions of the applet. Thats why you can get it working even unsigned.
Why do you want to avoid signing? Self signing works and its quite a straight forward process.
 
Billy Sclater
Ranch Hand
Posts: 145
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet is a volunteer job for a friend's website. His company is launching a game in October. I'll add more function to it of course, some links going to different review websites and so on.

About my aversion to self-signing, when I self-sign the applet, a big ugly warning box pops up on the screen with a scary yellow warning triangle and basically says "Do you trust this person?". I think it makes my friend's website look unattractive! I guess it's unavoidable though, then again I could use a decent CA and pay for a digital signature, perhaps then the scary warning box could be ommitted.

By the way, the applet is not essential to my friend's business in anyway, he is just helping me out by giving me some voluntary work to put on my resume!

Thanks again for your help!!
 
Paul Clapham
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's been a while since I worked with applets, and Oracle has made a lot of fixes to applet (and Java) security since then, so now I'm not sure how they work any more. It's possible that even using a corporate-grade digital signature from a recognized CA might still produce a warning box, but perhaps a less scary one. But I don't know that for sure.

However I can say that the company I worked for did run an application (for web ordering) which used a self-signed certificate for several years, and I never heard of any of our customers being scared off by the security dialog. I suppose that since it was on our website they assumed it was okay. People using the web routinely disregard web security, that's why malware writers are so successful.
 
Billy Sclater
Ranch Hand
Posts: 145
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your input. I've read a couple other posts with similar sentiments about signing and warnings. I think I'm going to be brave and self-sign the applet after all!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic