Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [Image] How to get the path of an Image ?
[Image] How to get the path of an Image ? [message #448390] Fri, 07 January 2005 17:13 Go to next message
Arnaud is currently offline ArnaudFriend
Messages: 60
Registered: July 2009
Member
Hi !

I know how to navigate the disk to choose the image to put on a button,
but I don't know how to programmatically return the path of the file an
image was loaded from.

Say I have an org.eclipse.swt.graphics.Image obtained from
Button.getImage(). This image comes from somewhere on the disk and I
would like to allow the user to choose another one from a FileDialog
witch opens in the directory of the current image.

TIA

--
Arnaud
Re: [Image] How to get the path of an Image ? [message #448394 is a reply to message #448390] Fri, 07 January 2005 18:30 Go to previous messageGo to next message
Avneesh Jain is currently offline Avneesh JainFriend
Messages: 11
Registered: July 2009
Junior Member
The piece of code that sets the image on the button can possibly can call
button.setData(String key, Object data) and pass the name of the directory.
Then your piece of code can use the button.getData(String key) to get the
location of the directory.

Avneesh
"Arnaud" <no@mail.please> wrote in message
news:crmfvl$k9u$1@www.eclipse.org...
> Hi !
>
> I know how to navigate the disk to choose the image to put on a button,
> but I don't know how to programmatically return the path of the file an
> image was loaded from.
>
> Say I have an org.eclipse.swt.graphics.Image obtained from
> Button.getImage(). This image comes from somewhere on the disk and I
> would like to allow the user to choose another one from a FileDialog
> witch opens in the directory of the current image.
>
> TIA
>
> --
> Arnaud
Re: [Image] How to get the path of an Image ? [message #448398 is a reply to message #448394] Fri, 07 January 2005 20:26 Go to previous message
Arnaud is currently offline ArnaudFriend
Messages: 60
Registered: July 2009
Member
Right, I use this feature everyday, but I thought there was something
already coded for that.

Thanks

--
Arnaud
Previous Topic:Is there any way to listen to Windows Application key?
Next Topic:DropTarget cleanup (COM-level) does not seem to be complete (org.eclipse.swt.SWTError: Cannot initia
Goto Forum:
  


Current Time: Thu Oct 22 21:56:18 GMT 2020

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

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

Back to the top