JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
GraphListPanel listPanel = new GraphListPanel("");
listPanel.setInitialData(graphs);
frame.add(listPanel, BorderLayout.WEST);
final GraphPanel graphPanel = new GraphPanel(Color.BLACK, Color.GREEN);
frame.add(graphPanel, BorderLayout.CENTER);
listPanel.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
JList list = (JList) e.getSource();
Graph graph = (Graph) list.getSelectedValue();
graphPanel.setGraph(graph);
}