creating nodes and edges in java

i have 3 ArrayLists namely reactants, products and modifiers. i need to show a network connecting reactants to products via modifiers. i am new to java. how do i represnt the network? how to display reactants, products and modifiers on the screen? how to connect them using arrowed lines?

i have 3 ArrayLists namely reactants, products and modifiers. i need to show a network connecting reactants to products via modifiers. i am new to java. how do i represnt the network? how to display reactants, products and modifiers on the screen? how to connect them using arrowed lines?

Do I understand you correctly if I say that reactants and products are the vertexes of the graph while modifiers make up the edges of the graph? Is the graph bipartite, i.e. can you divide the vertexes of the graph is two sets? Here those sets would be the reactants and products while all edges 'move' from one set to the other. Correct me if I'm wrong please.

i have to create a bipartite graph and also a normal network. in bipartite i have to connect the reactants to the modifiers and then modifiers to the product. (ie its a multi partite).
in the network, i need to show reactants and products as nodes connected by lines. it will be fine if modifiers are not included in this graph

i have to create a bipartite graph and also a normal network. in bipartite i have to connect the reactants to the modifiers and then modifiers to the product. (ie its a multi partite).
in the network, i need to show reactants and products as nodes connected by lines. it will be fine if modifiers are not included in this graph

That's easy: think of three vertical lines next to each other; the left line contains n points where the points are the vertexes representing the n reactants. The middle line contains m points where the points represent the m modifiers; the same goes for the line on the right: it contains the k products. Connect points from the first line to the second line and the same from the second line to the third line; you decide which lines have to be drawn. You also decide how fancy you want to draw those points on those three vertical lines; obviously it isn't necessary to draw those three vertical lines.

and how do i create the other graph showing ractants and products which are connected by lines?
i read something about JGraphT. can i use it? how to install it?
or is there any other way to show the interactions?