是否可以将 jgraphx 与 JavaFx 2.0 一起使用?
我尝试使用以下代码,但无法将图形组件添加到 JavaFx 组件。
mxGraph graph = new mxGraph();
Object parent = graph.getDefaultParent();
graph.getModel().beginUpdate();
try {
Object v1 = graph.insertVertex(parent, null, "Hello", 20, 20, 80,
30);
Object v2 = graph.insertVertex(parent, null, "World!", 240, 150,
80, 30);
graph.insertEdge(parent, null, "Edge", v1, v2);
} finally {
graph.getModel().endUpdate();
}
mxGraphComponent graphComponent = new mxGraphComponent(graph);
TitledPane tPane = new TitledPane();
tPane.setAnimated(false);
tPane.setExpanded(false);
tPane.setMaxWidth(1040);
tPane.setText("Load Module " + i);
tPane.setAnimated(true);
tPane.setContent(graphComponent); // Error here. setContent() does not accept graph
我如何使用/添加 jgraph 到 JavaFX 组件?有任何想法吗 ?