void init(){
		//super("GraphicEditor");
			addWindowListener(new WindowAdapter()
	       {
				public void windowClosing(WindowEvent e){System.exit(0);}});
			
			node.setText("Node");
			link.setText("Link");
			link.setMargin(new Insets(8,1,12,10));
			node.addActionListener(newNode);
			link.addActionListener(linkNode);
			setSize (800,800);
			topPanel = new JPanel();
			sidePanel = new JPanel();
			sidePanel.setLayout(new GridLayout(9,1));
			node.setPreferredSize(new Dimension(new ImageIcon("node.gif").getIconWidth(), new ImageIcon("node.gif").getIconWidth()));
			sidePanel.add(node);
			link.setLocation(1, 7);
			sidePanel.add(link);
			Font curFont = title.getFont();
			title.setFont(new Font(curFont.getFontName(), curFont.getStyle(), 24));
			title.setSize(80, 160);
			for (Options op : Options.values()) {
            combo.addItem(op);
          }
		 
		combo.addActionListener(comboAction);
          
	        btnPanel = new JPanel() {

				private static final long serialVersionUID = 1L;
				@Override
            public void paintComponent(Graphics g) {
			
				g.setColor(Color.white);
				g.fillRect(0, 0, width, height);
				g.setColor(Color.black);
				g.setFont(new Font("Arial",Font.BOLD,14));
	             int x1, x2, x3, y1, y2, y3;
				 int base = width/7;
	             g.drawString("Please Select number of steps - ", 110, 20);
	             g.drawString("The default is 10!", 160, 35);
	             x1 = (width/2)-(base/2);
	             x2 = (width/2)+(base/2);
	             x3 = width/2;
	             y1 = (height-(height/15))-base;
	             y2 = height-(height/15);
	             y3 = (height-(height/15))-(base+(base/2));
	             g.drawPolygon(new int[]{x1, x1, x2, x2, x1}, new int[]{y1, y2, y2, y1, y1}, 5);
	        	 n1 = temp;
	              if(--n1 > 0){
	            	  g.drawPolygon(new int[] {x1, x3, x2}, new int[] {y1, y3, y1}, 3);
	                 paintMore(n1, g, x1, x3, x2, y1, y3, y1);
	                 paintMore(n1, g, x2, x3, x1, y1, y3, y1);
	             }
	            
			}
			public void paintMore(int n1, Graphics g, double x1_1, double x2_1, double x3_1, double y1_1, double y2_1, double y3_1){
		        int x1, x2, x3, y1, y2, y3;

		        x1 = (int)(x1_1 + (x2_1-x3_1));
		        x2 = (int)(x2_1 + (x2_1-x3_1));
		        x3 = (int)(((x2_1 + (x2_1-x3_1)) + ((x2_1-x3_1)/2)) + ((x1_1-x2_1)/2));
		        y1 = (int)(y1_1 + (y2_1-y3_1));
		        y2 = (int)(y2_1 + (y2_1-y3_1));
		        y3 = (int)(((y1_1 + (y2_1-y3_1)) + ((y2_1-y1_1)/2)) + ((y2_1-y3_1)/2));

		        g.setColor(Color.green);
		        g.drawPolygon(new int[] {x1, x2, (int)x2_1, x1}, new int[] {y1, y2, (int)y2_1, y1}, 4);
		        g.drawLine((int)x1, (int)y1, (int)x1_1, (int)y1_1);
		        g.drawLine((int)x2_1, (int)y2_1, (int)x2, (int)y2);
		        g.drawLine((int)x1, (int)y1, (int)x2, (int)y2);

		        if(--n1 > 0){
		            g.drawLine((int)x1, (int)y1, (int)x3, (int)y3);
		            g.drawLine((int)x2, (int)y2, (int)x3, (int)y3);
		            paintMore(n1, g, x1, x3, x2, y1, y3, y2);
		            paintMore(n1, g, x2, x3, x1, y2, y3, y1);
		        }
		    }
	        };
			  js.setModel(new SpinnerNumberModel(10, 3,20,2));
			  js.addChangeListener(new ChangeListener(){

				@Override
				public void stateChanged(ChangeEvent e) {
					 JSpinner s = (JSpinner) e.getSource();
	                 temp = (Integer) s.getValue();
	                 System.out.println(temp);
	                 if(temp!=n1)
	                 { n1=temp;
	                    btnPanel.repaint();
	                 }
					
				}});

	        js.setLocation(300, 600);
	        btnPanel.add(js,BorderLayout.EAST);
	        
	        graphPanel = new JPanel(){

	        	
	        	private static final long serialVersionUID = 1L;
	        	 @Override
	        	    public Dimension getPreferredSize() {
	        	        return new Dimension(WIDE, HIGH);
	        	    }
				@Override
			    public void paintComponent(Graphics g) {
					
			        g.setColor(new Color(0x00f0f0f0));
			        g.fillRect(0, 0, getWidth(), getHeight());
			        for (Edge e : edges) {
			            e.draw(g);
			        }
			        for (Node n : nodes) {
			            n.draw(g);
			        }
			        if (selecting) {
			            g.setColor(Color.GREEN);
			            g.drawRect(mouseRect.x, mouseRect.y,
			                mouseRect.width, mouseRect.height);
			        }
			    }
			};
	        graphPanel.add(graphLabel1,BorderLayout.NORTH);
	        graphPanel.add(graphLabel2,BorderLayout.AFTER_LAST_LINE);
	        graphPanel.add(graphLabel3,BorderLayout.AFTER_LAST_LINE);
	        graphPanel.add(graphLabel4,BorderLayout.AFTER_LAST_LINE);
	        graphLabel3.setSize(450, 50);
	        graphLabel3.setFont(graphLabel2.getFont());
	        graphLabel3.setBackground(graphLabel2.getBackground());
	        graphLabel3.setLineWrap(true);
	        graphLabel4.setSize(450, 50);
	        graphLabel4.setFont(graphLabel2.getFont());
	        graphLabel4.setBackground(graphLabel2.getBackground());
	        graphLabel4.setLineWrap(true);
	        graphPanel.setVisible(false);
	        btnPanel.setVisible(true);
	        Dimension titled = new Dimension();
	        titled.height = 500;
	        titled.width = 800; 
	        title.setSize(titled);
	        
	        topPanel.setLayout(new GridBagLayout());
	         
	        GridBagConstraints c = new GridBagConstraints();
	        
	   
	        c.weightx = 0.5;
	        c.gridwidth = 3;
	        c.gridx = 2;
	        c.gridy = 0;
	        
	        topPanel.add(title, c);
	        
	        c.gridwidth = 3;
	        c.gridx = 1;
	        c.gridy = 1;
	        
	        
	        topPanel.add(new JLabel("Select an option from the dropdown:"), c);
	      
	        
	        c.gridx = 2;
	        c.gridy = 1;
	        
		    topPanel.add(combo, c);
		    
		     
	        c.gridx = 4;
	        c.gridy = 1;
	        JButton Clearall = new JButton(ClearButtonAction);
	        topPanel.add(Clearall, c);
	        add(topPanel, BorderLayout.NORTH);
	        
	       
	       add(btnPanel,BorderLayout.CENTER);
	        add(sidePanel,BorderLayout.WEST);
	        btnPanel.setVisible(false);
	        setVisible(true);
	     }