问题
I need to add legends to my frame to show the meaning of different colored links and nodes. Does Jung have some in built legend functionality? Or do I need make my own by adding an extra panel to the right.
回答1:
I added the legends in a simple way. First made an Image of the legends and then stick it to the panel via the JLabel.
JLabel label = new JLabel();
label.setOpaque(true);
label.setBackground(Color.WHITE);
ImageIcon icon = new ImageIcon("Legend/SyncLegend.png");
label.setIcon(icon);
vv.add(label);
来源:https://stackoverflow.com/questions/26013733/jung-add-legends-to-the-frame