org.eclipse.swt.graphics.Image [message #490618] |
Fri, 09 October 2009 12:43 |
hannes Messages: 12 Registered: October 2009 Location: Germany |
Junior Member |
|
|
Hi,
ive a problem with the following codelines
Image image = new Image(shell.getDisplay(), "./banner.jpg");
Label banner = new Label(composite,SWT.NONE);
banner.setImage(image);
I always get the error message
"java.lang.NoSuchMethodError: org.eclipse.swt.graphics.Image.<init>(Lorg/eclipse/swt/graphics/Device;Ljava/lang/String;)V"
The code works fine on as standalone application but not on RAP.
[Updated on: Fri, 09 October 2009 12:44] Report message to a moderator
|
|
|
|
|
|
Re: org.eclipse.swt.graphics.Image [message #490770 is a reply to message #490618] |
Sat, 10 October 2009 13:20 |
hannes Messages: 12 Registered: October 2009 Location: Germany |
Junior Member |
|
|
I acutally construct the image with
ImageRegistry registry = new ImageRegistry(Display.getCurrent());
registry.put("banner", ImageDescriptor.createFromFile(GUI.class, "banner.jpg"));
Image image = registry.get("banner");
Label banner = new Label(composite,SWT.NONE);
banner.setImage(image);
works fine, but if i try to scale the image with
registry.put("banner_rs", new Image(Display.getCurrent(), image.getImageData().scaledTo(450,64)));
image = registry.get("banner_rs");
ill get the following error
Exception in thread "UIThread [1a92ht0o8z644]" java.lang.IllegalStateException: The context has been disposed.
at org.eclipse.rwt.internal.service.ServiceContext.checkState(ServiceContext.java:154)
at org.eclipse.rwt.internal.service.ServiceContext.getRequest(ServiceContext.java:82)
at org.eclipse.rwt.internal.service.ContextProvider.getRequest(ContextProvider.java:129)
at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:148)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.setShutdownAdapter(RWTLifeCycle.java:350)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.access$0(RWTLifeCycle.java:347)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:133)
at java.lang.Thread.run(Unknown Source)
is it another bug, or do i something wrong ?
[Updated on: Sat, 10 October 2009 13:43] Report message to a moderator
|
|
|
Re: org.eclipse.swt.graphics.Image [message #490824 is a reply to message #490770] |
Sun, 11 October 2009 15:15 |
Benjamin Muskalla Messages: 338 Registered: July 2009 |
Senior Member |
|
|
Hi,
*please* be sure to work against the RAP target platform. The code you
mentioned just won't compile with RAP. And add the -consolelog parameter
to your launch config to see errors that happen during runtime. What you
currently see is only a follow-up error of a degenerated session.
Regards,
Ben
h4nn3s@inbox.com wrote:
> I acutally construct the image with
>
> ImageRegistry registry = new ImageRegistry(Display.getCurrent());
> registry.put("banner", ImageDescriptor.createFromFile(GUI.class, Image
> image = registry.get("banner");
> Image image = registry.get("banner");
> Label banner = new Label(composite,SWT.NONE);
> banner.setImage(image);
>
>
> works fine, but if i try to scale the image with
>
> registry.put("banner_rs", new Image(Display.getCurrent(),
> image.getImageData().scaledTo(450,64)));
> image = registry.get("banner_rs");
>
>
> ill get the following error
>
>
> Exception in thread "UIThread [1a92ht0o8z644]"
> java.lang.IllegalStateException: The context has been disposed.
> at
> org.eclipse.rwt.internal.service.ServiceContext.checkState(S erviceContext.java:154)
>
> at
> org.eclipse.rwt.internal.service.ServiceContext.getRequest(S erviceContext.java:82)
>
> at
> org.eclipse.rwt.internal.service.ContextProvider.getRequest( ContextProvider.java:129)
>
> at
> org.eclipse.rwt.internal.service.ContextProvider.getSession( ContextProvider.java:148)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.setShutdownA dapter(RWTLifeCycle.java:350)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.access$0(RWT LifeCycle.java:347)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:133)
>
> at java.lang.Thread.run(Unknown Source)
>
>
>
> is it another bug, or do i something wrong ?
--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
|
|
|
Powered by
FUDForum. Page generated in 0.05803 seconds