| Inserting image in a node [message #681999] |
Fri, 10 June 2011 03:53  |
fenrir Messages: 15 Registered: April 2011 Location: France |
Junior Member |
|
|
Hi
I want to insert an image in a diagram node. I tried the method I found which consists to put this code in XXXEditPart, modifying the XXXFigure constructor
but it doesn't works ='(
/**
* @generated NOT
*/
public XXXFigure() {
// Get the picture
Image img = new Image(null,"c:\\toto.png");
ImageFigure imgF = new ImageFigure();
imgF.setImage(img);
// Add it to the figure
this.add(imgF);
// Set figure size as picture size
this.setMaximumSize(imgF.getSize());
this.setMinimumSize(imgF.getSize());
createContents();
}
Can anybody help me please? (It's an urgent problem)
Thanks
[Updated on: Fri, 10 June 2011 05:10] Report message to a moderator
|
|
|
| Re: Inserting image in a node [message #682028 is a reply to message #681999] |
Fri, 10 June 2011 05:09  |
fenrir Messages: 15 Registered: April 2011 Location: France |
Junior Member |
|
|
Ok, my problem is resolved : I just forgot that I put a BorderLayout.
Just changed
this.add(imgF);
to
this.add(imgF, BorderLayout.CENTER);
and it works =)
|
|
|
Powered by
FUDForum. Page generated in 0.01457 seconds