dudules40
Nouveau membre
Bonjour,
je voudrais afficher un TextViewer dans un composite (de Layout gridLayout) avec un bouton, seulement à l'execution j'obtiens l'exception suivante :
java.lang.NoClassDefFoundError: org/eclipse/jface/text/BadLocationException
at test.main(test.java:37)
Exception in thread "main"
voici le code de la classe :
public static void main(String[] args) {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");
final Composite composite = new Composite(shell, SWT.NONE);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
composite.setLayout(gridLayout);
composite.setBounds(-2, 2, 431, 263);
final TextViewer textViewer = new TextViewer(composite, SWT.BORDER);
textViewer.setInput(new Object());
final Button button = new Button(composite, SWT.NONE);
button.setText("button");
shell.layout();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
qqun sait pourquoi ?
je voudrais afficher un TextViewer dans un composite (de Layout gridLayout) avec un bouton, seulement à l'execution j'obtiens l'exception suivante :
java.lang.NoClassDefFoundError: org/eclipse/jface/text/BadLocationException
at test.main(test.java:37)
Exception in thread "main"
voici le code de la classe :
public static void main(String[] args) {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");
final Composite composite = new Composite(shell, SWT.NONE);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
composite.setLayout(gridLayout);
composite.setBounds(-2, 2, 431, 263);
final TextViewer textViewer = new TextViewer(composite, SWT.BORDER);
textViewer.setInput(new Object());
final Button button = new Button(composite, SWT.NONE);
button.setText("button");
shell.layout();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
qqun sait pourquoi ?