@Override
        public void mouseReleased(MouseEvent e) {
            selecting = false;
           
            mouseEndPt = e.getPoint(); 
            Node n1=null;
            Node n2 = null;
            graphPanel.add(graphLabel5,BorderLayout.PAGE_END);
            graphLabel5.setVisible(false);
            mouseRect.setBounds(0, 0, 0, 0);
            if(linkMode)
            	if (nodes.size() > 1) {
	                for (int i = 0; i < nodes.size(); ++i) {
	                	
	                	if(nodes.get(i).contains(mouseStartPt))
	                	{
	                		
	                     n1 = nodes.get(i);
	                   
	                	}
	                	else if(nodes.get(i).contains(mouseEndPt))
	                    {
	                		n2 = nodes.get(i );
	                		
	                    }
	                   
	                	graphLabel5.setVisible(false); 
	                }
	                
					if(n1!=null && n2!=null)
	                {edges.add(new Edge(n1, n2));
					graphLabel5.setVisible(false);
	                }
	                else
	                	{graphLabel5.setForeground(Color.RED);
	                	graphLabel5.setVisible(true);
	                	}
	                
	            }
	           
           
            e.getComponent().repaint();
        }