Jung: Add legends to the frame

十年热恋 提交于 2019-12-11 10:15:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!