Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT in applets
SWT in applets [message #452214] Tue, 15 March 2005 14:13 Go to next message
Kalman Hazins is currently offline Kalman HazinsFriend
Messages: 76
Registered: July 2009
Member
Hi group.

I am looking at Snippet157 (embedding word into applet) and wondering how it
would work in real life (i.e. in a regular browser and not in appletviewer).

I imagine, that I'll probably need to include swt.jar in the applet tag, but
am wondering if I would also need to include the .dll files and how would
that work exactly?

Thanx for any help,
- Kalman

P.S. The snippet looks very convincing, but if you can't take it outside of
eclipse appletviewer - it's pretty much useless.
Re: SWT in applets [message #458407 is a reply to message #452214] Wed, 13 July 2005 01:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mc.solaar.gmx.net

hi,

i also tried this example. swt.jar is not a problem, but the .dll is
tricky. so i built a signed applet. i can download the .dll an call
System.load(..) but it doesn't work really.
here is my code:
------------------

public void init () {
String tmpDir = System.getProperty("java.io.tmpdir");
System.out.println("TempDir="+tmpDir);
location= tmpDir+"swt-win32-3063.dll";

try {
System.load(location);
System.out.println("library loaded");
}
catch (UnsatisfiedLinkError ule) {
System.out.println("dll not found -> download");
if (!GetFile.get( "http://localhost:8080/files/swt-win32-3063.dll",
tmpDir)){
System.out.println("Error downloading file!");
return;
}
try {
Runtime.getRuntime().loadLibrary(location);
}catch (UnsatisfiedLinkError ule2) {
System.out.println("dll not found after download");
System.out.println("Location:"+location);
ule2.printStackTrace();
return;
}
}
// the code frome snippet Snippet157
Thread thread = new Thread (new Runnable () {
public void run () {
setLayout(new java.awt.GridLayout (1, 1));
awtParent = new java.awt.Canvas ();
add (awtParent);
display = new org.eclipse.swt.widgets.Display ();
<------- here comes an error ... :
Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission swt.version read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)



and the html file:
-------------------

<HTML>
<HEAD>
<TITLE>...</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<APPLET code="WordAppletApp.class" NAME="WordApplet" WIDTH="670"
HEIGHT="540" ALIGN="bottom" archive="sWordApplet.jar,swt.jar">bla</APPLET>
</BODY>
</HTML>

any ideas? any help? how do i include and manage the .java.policy in
the signed .jar file?

THX!


Kalman schrieb:
> Hi group.
>
> I am looking at Snippet157 (embedding word into applet) and wondering how it
> would work in real life (i.e. in a regular browser and not in appletviewer).
>
> I imagine, that I'll probably need to include swt.jar in the applet tag, but
> am wondering if I would also need to include the .dll files and how would
> that work exactly?
>
> Thanx for any help,
> - Kalman
>
> P.S. The snippet looks very convincing, but if you can't take it outside of
> eclipse appletviewer - it's pretty much useless.
>
>
Re: SWT in applets [message #458408 is a reply to message #458407] Wed, 13 July 2005 02:10 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
McSolaar:
> hi,
>
> i also tried this example. swt.jar is not a problem, but the .dll is
> tricky. so i built a signed applet. i can download the .dll an call
> System.load(..) but it doesn't work really.

I was able to do this some time ago...
May be you should also sign swt.jar


> here is my code:
> ------------------
>
> public void init () {
> String tmpDir = System.getProperty("java.io.tmpdir");
> System.out.println("TempDir="+tmpDir);
> location= tmpDir+"swt-win32-3063.dll";
>
> try {
> System.load(location);
> System.out.println("library loaded");
> }
> catch (UnsatisfiedLinkError ule) {
> System.out.println("dll not found -> download");
> if (!GetFile.get(
> "http://localhost:8080/files/swt-win32-3063.dll", tmpDir)){
> System.out.println("Error downloading file!");
> return;
> }
> try {
> Runtime.getRuntime().loadLibrary(location);
> }catch (UnsatisfiedLinkError ule2) {
> System.out.println("dll not found after download");
> System.out.println("Location:"+location);
> ule2.printStackTrace();
> return;
> }
> }
> // the code frome snippet Snippet157
> Thread thread = new Thread (new Runnable () {
> public void run () {
> setLayout(new java.awt.GridLayout (1, 1));
> awtParent = new java.awt.Canvas ();
> add (awtParent);
> display = new org.eclipse.swt.widgets.Display ();
> <------- here comes an error ... :
> Caused by: java.security.AccessControlException: access denied
> (java.util.PropertyPermission swt.version read)
> at java.security.AccessControlContext.checkPermission(Unknown Source)
> at java.security.AccessController.checkPermission(Unknown Source)
>
>
>
> and the html file:
> -------------------
>
> <HTML>
> <HEAD>
> <TITLE>...</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF">
> <APPLET code="WordAppletApp.class" NAME="WordApplet" WIDTH="670"
> HEIGHT="540" ALIGN="bottom" archive="sWordApplet.jar,swt.jar">bla</APPLET>
> </BODY>
> </HTML>
>
> any ideas? any help? how do i include and manage the .java.policy in
> the signed .jar file?
>
> THX!
>
>
> Kalman schrieb:
>
>> Hi group.
>>
>> I am looking at Snippet157 (embedding word into applet) and wondering
>> how it
>> would work in real life (i.e. in a regular browser and not in
>> appletviewer).
>>
>> I imagine, that I'll probably need to include swt.jar in the applet
>> tag, but
>> am wondering if I would also need to include the .dll files and how would
>> that work exactly?
>>
>> Thanx for any help,
>> - Kalman
>>
>> P.S. The snippet looks very convincing, but if you can't take it
>> outside of
>> eclipse appletviewer - it's pretty much useless.
>>
>>


Konstantin Scheglov,
Google, Inc.
Re: SWT in applets [message #458420 is a reply to message #458407] Wed, 13 July 2005 13:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"McSolaar" <mc.solaar@gmx.net> wrote in message
news:db1sgk$uba$1@news.eclipse.org...
> hi,
>
> i also tried this example. swt.jar is not a problem, but the .dll is
> tricky. so i built a signed applet. i can download the .dll an call
> System.load(..) but it doesn't work really.
>
Perhaps repackage swt.jar to contain the dll? Then finding and loading the
dll should happen within the context of the jar file.
Caveat: I haven't really tried this out- I'm just guessing it might work.
---
Sunil
Re: SWT in applets [message #458468 is a reply to message #458408] Thu, 14 July 2005 00:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mc.solaar.gmx.net

Konstantin Scheglov schrieb:
> McSolaar:
>
>> hi,
>>
>> i also tried this example. swt.jar is not a problem, but the .dll is
>> tricky. so i built a signed applet. i can download the .dll an call
>> System.load(..) but it doesn't work really.
>
>
> I was able to do this some time ago...
> May be you should also sign swt.jar

didn't work ...
i included the .dll in the swt.jar and signed it ..
it also didn't work with any browser (thunderbird or IE), only with the
appletviewer with permission settings

i'm using java 1.5.0_01

any ideas?
THX

>
>
>> here is my code:
>> ------------------
>>
>> public void init () {
>> String tmpDir = System.getProperty("java.io.tmpdir");
>> System.out.println("TempDir="+tmpDir);
>> location= tmpDir+"swt-win32-3063.dll";
>> try {
>> System.load(location);
>> System.out.println("library loaded");
>> }
>> catch (UnsatisfiedLinkError ule) {
>> System.out.println("dll not found -> download");
>> if (!GetFile.get(
>> "http://localhost:8080/files/swt-win32-3063.dll", tmpDir)){
>> System.out.println("Error downloading file!");
>> return;
>> }
>> try {
>> Runtime.getRuntime().loadLibrary(location);
>> }catch (UnsatisfiedLinkError ule2) {
>> System.out.println("dll not found after download");
>> System.out.println("Location:"+location);
>> ule2.printStackTrace();
>> return;
>> }
>> }
>> // the code frome snippet Snippet157
>> Thread thread = new Thread (new Runnable () {
>> public void run () {
>> setLayout(new java.awt.GridLayout (1, 1));
>> awtParent = new java.awt.Canvas ();
>> add (awtParent);
>> display = new org.eclipse.swt.widgets.Display ();
>> <------- here comes an error ... :
>> Caused by: java.security.AccessControlException: access denied
>> (java.util.PropertyPermission swt.version read)
>> at java.security.AccessControlContext.checkPermission(Unknown Source)
>> at java.security.AccessController.checkPermission(Unknown Source)
>>
>>
>>
>> and the html file:
>> -------------------
>>
>> <HTML>
>> <HEAD>
>> <TITLE>...</TITLE>
>> </HEAD>
>> <BODY BGCOLOR="#FFFFFF">
>> <APPLET code="WordAppletApp.class" NAME="WordApplet" WIDTH="670"
>> HEIGHT="540" ALIGN="bottom"
>> archive="sWordApplet.jar,swt.jar">bla</APPLET>
>> </BODY>
>> </HTML>
>>
>> any ideas? any help? how do i include and manage the .java.policy in
>> the signed .jar file?
>>
>> THX!
>>
>>
>> Kalman schrieb:
>>
>>> Hi group.
>>>
>>> I am looking at Snippet157 (embedding word into applet) and wondering
>>> how it
>>> would work in real life (i.e. in a regular browser and not in
>>> appletviewer).
>>>
>>> I imagine, that I'll probably need to include swt.jar in the applet
>>> tag, but
>>> am wondering if I would also need to include the .dll files and how
>>> would
>>> that work exactly?
>>>
>>> Thanx for any help,
>>> - Kalman
>>>
>>> P.S. The snippet looks very convincing, but if you can't take it
>>> outside of
>>> eclipse appletviewer - it's pretty much useless.
>>>
>>>
Re: SWT in applets [message #458533 is a reply to message #458468] Thu, 14 July 2005 15:52 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
McSolaar:

Sorry, I don't know.
I'm on vacation now and my test is in office...

>>> i also tried this example. swt.jar is not a problem, but the .dll is
>>> tricky. so i built a signed applet. i can download the .dll an call
>>> System.load(..) but it doesn't work really.
>>
>>
>>
>> I was able to do this some time ago...
>> May be you should also sign swt.jar
>
>
> didn't work ...
> i included the .dll in the swt.jar and signed it ..
> it also didn't work with any browser (thunderbird or IE), only with the
> appletviewer with permission settings
>
> i'm using java 1.5.0_01
>
> any ideas?
> THX
>
>>
>>
>>> here is my code:
>>> ------------------
>>>
>>> public void init () {
>>> String tmpDir = System.getProperty("java.io.tmpdir");
>>> System.out.println("TempDir="+tmpDir);
>>> location= tmpDir+"swt-win32-3063.dll";
>>> try {
>>> System.load(location);
>>> System.out.println("library loaded");
>>> }
>>> catch (UnsatisfiedLinkError ule) {
>>> System.out.println("dll not found -> download");
>>> if (!GetFile.get(
>>> "http://localhost:8080/files/swt-win32-3063.dll", tmpDir)){
>>> System.out.println("Error downloading file!");
>>> return;
>>> }
>>> try {
>>> Runtime.getRuntime().loadLibrary(location);
>>> }catch (UnsatisfiedLinkError ule2) {
>>> System.out.println("dll not found after download");
>>> System.out.println("Location:"+location);
>>> ule2.printStackTrace();
>>> return;
>>> }
>>> }
>>> // the code frome snippet Snippet157
>>> Thread thread = new Thread (new Runnable () {
>>> public void run () {
>>> setLayout(new java.awt.GridLayout (1, 1));
>>> awtParent = new java.awt.Canvas ();
>>> add (awtParent);
>>> display = new org.eclipse.swt.widgets.Display ();
>>> <------- here comes an error ... :
>>> Caused by: java.security.AccessControlException: access denied
>>> (java.util.PropertyPermission swt.version read)
>>> at java.security.AccessControlContext.checkPermission(Unknown
>>> Source)
>>> at java.security.AccessController.checkPermission(Unknown Source)
>>>
>>>
>>>
>>> and the html file:
>>> -------------------
>>>
>>> <HTML>
>>> <HEAD>
>>> <TITLE>...</TITLE>
>>> </HEAD>
>>> <BODY BGCOLOR="#FFFFFF">
>>> <APPLET code="WordAppletApp.class" NAME="WordApplet" WIDTH="670"
>>> HEIGHT="540" ALIGN="bottom"
>>> archive="sWordApplet.jar,swt.jar">bla</APPLET>
>>> </BODY>
>>> </HTML>
>>>
>>> any ideas? any help? how do i include and manage the .java.policy
>>> in the signed .jar file?
>>>
>>> THX!
>>>
>>>
>>> Kalman schrieb:
>>>
>>>> Hi group.
>>>>
>>>> I am looking at Snippet157 (embedding word into applet) and
>>>> wondering how it
>>>> would work in real life (i.e. in a regular browser and not in
>>>> appletviewer).
>>>>
>>>> I imagine, that I'll probably need to include swt.jar in the applet
>>>> tag, but
>>>> am wondering if I would also need to include the .dll files and how
>>>> would
>>>> that work exactly?
>>>>
>>>> Thanx for any help,
>>>> - Kalman
>>>>
>>>> P.S. The snippet looks very convincing, but if you can't take it
>>>> outside of
>>>> eclipse appletviewer - it's pretty much useless.
>>>>
>>>>


Konstantin Scheglov,
Google, Inc.
Previous Topic:TreeColumns not shorting long text
Next Topic:Typeahead in combo
Goto Forum:
  


Current Time: Thu Apr 25 06:39:23 GMT 2024

Powered by FUDForum. Page generated in 0.03892 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top