JGraphX is an open source Java Swing Component. It is the architecture written after JGraph 5, but not named JGraph 6 because it is rewritten and the API is entirely different.
Questions tagged [jgraphx]
182 questions
11
votes
1 answer
Automatic Layout for a Graph (JGraphX)
I have trouble to display a JGraphX with automatic layout.
My program (code below) creates an output like this:
A sufficiant result could be look like this (I moved them by hand):
I do not have to stick with JGraphX. I also tested JUNG and…

froehli
- 904
- 1
- 11
- 35
6
votes
1 answer
java JGraphx save as an image
Does anyone know how to export JGraphx as an image in any format? If not, then does anyone know any other java library that will let me create simple diagrams and then save it as an image?

user2715924
- 63
- 1
- 5
5
votes
2 answers
JGraphX - Want Entire Graph to be Uneditable
I couldn't find an answer in the manual, or on SO. I want to make a graph with JGraphX that displays some verices and edges, but I don't want the user to be able to move anything around, nor for those green edit boxes to appear on the vortexes or…

Cartesian Theater
- 1,920
- 2
- 29
- 49
4
votes
0 answers
Rotating mxCell in jgraphx
I want to rotate a cell in jgraphx. For this purpose, I used the style of cell as follows:
mxCell v2 =(mxCell) graph.insertVertex(parent, null, "World!", 240, 150, 80, 30,"rotation=90");
This causes the cell to rotate. However, the green box around…

Matin Meskin
- 86
- 9
4
votes
3 answers
JGraphX Moving cells and keeping edges
I try to move a graph in JGraphX. My first try was to use setGeometry, but this moves also the entire coordinate system and its origin. So this is no option for me, because it is a bit tricky when moving several graphs.
My second try with
Object[]…

Marco
- 1,579
- 1
- 19
- 34
4
votes
0 answers
Layout from sinks in Hierarchical layout
Problem
Earlier versions (1.x) of JGraphX offered the attribute layoutFromSinks in the mxHierarchicalLayout class. This isn't available anymore and from what I've seen hasn't been for a long time.
The problem of the layout difference is best…

Roland
- 18,114
- 12
- 62
- 93
4
votes
1 answer
JGraphX - Autolayout edges only
Is there anyway i can a run auto-layout on graph edges only?
I have a lot of fixed vertexes that i do not want to move/rearrange, but i do want to fix edges that overlap my cell/vertexes.
Is there any way to do this?

MarkNL
- 41
- 2
4
votes
1 answer
How do I set the component background to a specific color in JGraphX?
I want to make the background of a JGraphX graph component (https://github.com/jgraph/jgraphx) a specific color all over. I tried the standard call for any Swing component:
graphComponent.setBackground(Color.BLACK);
but this has no effect. I tried…

user3062529
- 87
- 1
- 8
3
votes
1 answer
How to create a hierarchical tree with collapsible nodes in JGraphX
I need an org chart tree and I want to be able to collapse and expand the nodes at any level. I am new to JGraphX but from what I have read it sounds like the way to implement folding is to group the vertexes. The problem is when I create the group…

cchampion
- 7,607
- 11
- 41
- 51
3
votes
2 answers
Overlapping edges with JGraphx
I'm building a graph with JgraphX. The directed graph represent roads and intersections. For every route I define two edges, one for each direction.
As result, the image of the graph has the two edges (representing the road) overlapped. How can I…

Fabrizio R.
- 117
- 1
- 14
3
votes
1 answer
Customizing JGraphX
I have been using JGraphX to display some data (simple discrete graphs) and I would like to know how to do the following things with the JGraphX library:
Make all edges unmovable but still allow the user to create an edge between two vertices
Make…
user400055
3
votes
1 answer
Removing duplicate vertices in a graph using JGraphX
I have a single vertex (vertex A)being connected to two different vertices(B & C) . But it gets duplicated and shows the same vertex (A)being connected to the two different vertices(B & C). How can I make a single vertex (A) with 2 edges coming out…

span
- 75
- 6
3
votes
1 answer
How to remove Vertex in JGraphX lib?
I'm trying to solve a task where i need to display graph in Swing. Found JGraph framework (which is now called JGraphX). In samples the graph.insertVertex(...) method is used for adding Vertices and the graph.insertEdge(...) method for Edges - ok it…

shagi
- 629
- 8
- 25
3
votes
0 answers
mxHierarchicalLayout not working as expected
I'm using JGraphx to draw a graph inside a Swing Panel and all works fine.
I try to insert two cells inside a target cell and is working, but layout is changing and all cells are not horizontal.
So my example is:
1) build a graph with some…

Vokail
- 630
- 8
- 27
3
votes
1 answer
Changing the color of an edge using JGraphXAdapter
I'm using the JGraphT library, in particular JGraphXAdapter to display graphs using JGraphX. I would like to change the color of a few edges (not all of them). My question is, how can that be accomplished? (I know how to change the default style for…

Edward Doolittle
- 4,002
- 2
- 14
- 27