refreshing the view

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

refreshing the view

Michał Urban
ello I've created graph using JGraphT library
g = new ListenableUndirectedWeightedGraph <String, MyEdge>(MyEdge.class);
        graphAdapter = new JGraphXAdapter<String, MyEdge>(g);

        layout = new mxOrganicLayout(graphAdapter);

        mxGraphComponent component = new mxGraphComponent(graphAdapter);

        component.setPreferredSize(new Dimension(dim.width - 50, dim.height - 200));


and I want to add dynamically a new vertex after pushing the button

@Override public void actionPerformed(ActionEvent e) { String a="1"; String b="2";
        g.addEdge(a,b); } public static class MyEdge extends DefaultWeightedEdge { //weight @Override public String toString() { return String.valueOf(getWeight()); } }

how can I refresh the view?

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
jgrapht-users mailing list
[hidden email]