荣格:添加传说框架(Jung: Add legends to the frame)

2019-10-21 01:40发布

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.

Answer 1:

我加入了传说中的简单方法。 先制成的图例的图像,然后将其粘到经由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);



文章来源: Jung: Add legends to the frame