Problème insertion d'image
Bonsoir,
Je m'en remet à vous pour m'aider à insérer une image dans mon 'group'.
Voici mon code ainsi que l'erreur :
Code:
1 2 3 4 5 6 7 8
| group = new Group(composite, SWT.NONE);
final GridLayout gridLayoutGroup = new GridLayout();
gridLayoutGroup.numColumns = 1;
group.setLayout(gridLayoutGroup);
Image image = new Image(display, "C:\\Program Files\\Eclipse\\logo.jpg");
Button bouton = new Button(group, SWT.FLAT);
bouton.setImage(image);
image.dispose(); |
Citation:
Exception in thread "main" org.eclipse.swt.SWTException: Graphic is disposed
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.graphics.Image.getBounds(Unknown Source)
at org.eclipse.swt.widgets.Button.computeSize(Unknown Source)
at org.eclipse.swt.layout.GridData.computeSize(Unknown Source)
at org.eclipse.swt.layout.GridLayout.layout(Unknown Source)
at org.eclipse.swt.layout.GridLayout.computeSize(Unknown Source)
at org.eclipse.swt.widgets.Composite.computeSize(Unknown Source)
at org.eclipse.swt.widgets.Group.computeSize(Unknown Source)
at org.eclipse.swt.layout.GridData.computeSize(Unknown Source)
at org.eclipse.swt.layout.GridLayout.layout(Unknown Source)
at org.eclipse.swt.layout.GridLayout.layout(Unknown Source)
at org.eclipse.swt.widgets.Composite.updateLayout(Unknown Source)
at org.eclipse.swt.widgets.Composite.layout(Unknown Source)
at org.eclipse.swt.widgets.Composite.layout(Unknown Source)
at org.eclipse.swt.widgets.Composite.layout(Unknown Source)
at listeArticles.<init>(listeArticles.java:197)
at index.main(index.java:54)
Merci beaucoup :)