2014-09-24 61 views
1

我需要將圖例添加到我的框架中,以顯示不同顏色的鏈接和節點的含義。 榮格是否有一些內置的圖例功能?或者我需要通過在右側添加額外面板來實現自己的功能。Jung:將圖例添加到框架

enter image description here

回答

2

我加入了傳說中的簡單方法。首先製作了傳奇的圖像,然後通過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); 

enter image description here