SWT in applets [message #452214] |
Tue, 15 March 2005 09:13  |
Eclipse User |
|
|
|
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] |
Tue, 12 July 2005 21:58   |
Eclipse User |
|
|
|
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] |
Tue, 12 July 2005 22:10   |
Eclipse User |
|
|
|
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.
>>
>>
|
|
|
|
Re: SWT in applets [message #458468 is a reply to message #458408] |
Wed, 13 July 2005 20:37   |
Eclipse User |
|
|
|
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 11:52  |
Eclipse User |
|
|
|
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.
>>>>
>>>>
|
|
|
Powered by
FUDForum. Page generated in 0.24558 seconds