GraphStream Users

Archives de la liste Aide

GraphStream usage issue

Chronologique Discussions 
  • From: Bilal Najeeb <bilal.najeeb2011 AT>
  • To: users AT, dev AT
  • Subject: GraphStream usage issue
  • Date: Mon, 2 May 2016 20:04:01 +0500

Greetings everyone,

I am Bilal, a software engineer from Pakistan. First of all i would like to tell you that the graphstream library is admirable, great work.

I am currently working on a project in which i have to generate some graphical output and I am using graphstream. From the tutorial given on the website, it is working fine when i make a separate test project in net beans for interactive graph which would respond to click events but when i try to do the same thing in the project I am working on, the graph wont appear just a Jframe and that too even wont close when i click on the cross button. I am pasting my code below kindly help me out. I shall be very great-full to you guys.

This is the code of the button click event from another Jframe

private void btnGraphStreamActionPerformed(java.awt.event.ActionEvent evt) {                                               
        new Clicks();

and this is the code where the graph will actually be made

package forms;
import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.SingleGraph;
import org.graphstream.ui.view.Viewer;
import org.graphstream.ui.view.ViewerListener;
import org.graphstream.ui.view.ViewerPipe;

public class Clicks implements ViewerListener{
    protected boolean loop = true;
    public Clicks() {
Graph graph = new SingleGraph("Clicks");
Viewer viewer = graph.display();
ViewerPipe fromViewer = viewer.newViewerPipe();
while(loop) {
public void viewClosed(String id) {
loop = false;
public void buttonPushed(String id) {
System.out.println("Button pushed on node "+id);
public void buttonReleased(String id) {
System.out.println("Button released on node "+id);

kindly reply me as soon as possible.


Archives gérées par MHonArc 2.6.16.

Top of page