Swing components not editable [message #661652] |
Fri, 25 March 2011 17:40 |
Uhlersoth 872325412 Messages: 8 Registered: July 2009 |
Junior Member |
|
|
I'm currently trying to figure out how to handle HTML in an Eclipse plugin (http:// www.eclipse.org/forums/index.php?t=msg&th=206632&sta rt=0&S=7ea6e307b48490c443b3c591928c21e8).
My second attempt is to embed a JEditorPane inside my Eclipse editor as follows:
public HTMLEditor(Composite parent) {
super(parent, SWT.EMBEDDED);
html = new JEditorPane();
html.setContentType("text/html");
html.setEnabled(true);
html.setEditable(true);
frame = SWT_AWT.new_Frame(this);
frame.add(new JScrollPane(html));
frame.setEnabled(true);
}
compose = new HTMLEditor(getContainer());
compose.setText("<html><body><h1>Title of the Page</h1>hello world</body></html>");
int index = addPage(compose);
The panel appears just fine in my Eclipse editor. However, it's not editable. Any ideas why? The same code works fine in a plain old Java app.
|
|
|
Powered by
FUDForum. Page generated in 0.02838 seconds