Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » javafx used in linux eclipse RCP swt(javafx used in linux eclipse RCP swt)
icon11.gif  javafx used in linux eclipse RCP swt [message #1734014] Fri, 03 June 2016 03:19
ljm ljm is currently offline ljm ljmFriend
Messages: 1
Registered: June 2016
Junior Member
I want to use JFXPanel in linux eclipse RCP Swt, but I have a problem´╝î
error info :
Exception in thread "JavaFX Application Thread" org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.widgets.Widget.error(
at org.eclipse.swt.widgets.Widget.checkWidget(
at org.eclipse.swt.custom.CTabFolder.setSelectionForeground(
at org.eclipse.ui.internal.presentations.PaneFolder.setSelectionForeground(
at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.updateColors(
at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.shellActive(
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder$2.shellDeactivated(
at org.eclipse.swt.widgets.TypedListener.handleEvent(
at org.eclipse.swt.widgets.EventTable.sendEvent(
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Shell.filterProc(
at org.eclipse.swt.widgets.Display.filterProc(
at Method)
at$3$ Source)
at Source)
this source core :
public class TestView
public static void main(String[] args)
final String htmlfile = "file:///home/line.html";
Display display = new Display();
Shell shell = new Shell(display);
shell.setText(" Hello World");
shell.setBounds(100, 100, 300, 100);
shell.setLayout(new FillLayout());
Button btn = new Button(shell, SWT.CENTER);
btn.addSelectionListener(new SelectionAdapter()
public void widgetSelected(SelectionEvent e)
System.out.println("click button!");
JFrame frame = new JFrame("Swing and JavaFX");
final JFXPanel fxPanel = new JFXPanel();
Platform.runLater(new Runnable()
public void run()
StackPane root = new StackPane();
Scene scene = new Scene(root);
WebView webView = new WebView();
WebEngine webEngine = webView.getEngine();
frame.add(fxPanel, BorderLayout.CENTER);
frame.setSize(640, 480);
while (!shell.isDisposed())
if (!display.readAndDispatch())
Previous Topic:Eclipse Java 4.5 Mars .2: Create a Java Project Wizard GUI Hung -- how to remove GUI from desktop?
Next Topic:Excel file getting corrupted
Goto Forum:

Current Time: Wed Oct 21 19:16:00 GMT 2020

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

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

Back to the top